Skip to content

Workflow file for this run

name: Check Set-Up & Build
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [main]
pull_request:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
check:
# The type of runner that the job will run on
runs-on: ubuntu-22.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install Rust toolchain
run: |
rustup set profile minimal
rustup show
- name: Ensure Rust formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: 3.20.1
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install sccache and dependencies
continue-on-error: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SCCACHE_BUCKET: "agicommies-subspace-cache"
SCCACHE_ENDPOINT: ${{ vars.SCCACHE_ENDPOINT }}
SCCACHE_REGION: auto
run: |
curl https://github.com/mozilla/sccache/releases/download/v0.7.7/sccache-v0.7.7-x86_64-unknown-linux-musl.tar.gz \
-Lo sccache-v0.7.7-x86_64-unknown-linux-musl.tar.gz
tar -xzf sccache-v0.7.7-x86_64-unknown-linux-musl.tar.gz --strip-components=1 sccache-v0.7.7-x86_64-unknown-linux-musl/sccache
./sccache --start-server
echo "RUSTC_WRAPPER=${{ github.workspace }}/sccache" >> "$GITHUB_ENV"
- name: Check Clippy errors
uses: actions-rs/clippy-check@v1
continue-on-error: true
env:
SKIP_WASM_BUILD: 1
with:
args: --color=always --timings -- -D warnings
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
env:
SKIP_WASM_BUILD: 1
run: cargo test