Skip to content

Revamp all CI jobs #501

Revamp all CI jobs

Revamp all CI jobs #501

Workflow file for this run

name: Lint, check, clippy and test
on:
push:
branches: [ main ]
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Use Nightly with `rustfmt`
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt
- uses: actions/checkout@v4
- name: Check formatting
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: fmt
args: --all -- --check
check:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Setup Ubuntu dependencies
shell: bash
run: sudo apt update && sudo apt install -y protobuf-compiler
- name: Use Nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: wasm32-unknown-unknown
components: rust-src
- uses: actions/checkout@v4
- name: Rust Cache
uses: swatinem/rust-cache@v2
with:
cache-on-failure: true
cache-all-crates: true
key: check
- name: Check Build
uses: actions-rs/cargo@v1
with:
command: check
toolchain: nightly
args: --release --locked --all-features --workspace
clippy:
needs: lint
runs-on: ubuntu-latest
permissions:
checks: write
env:
SKIP_WASM_BUILD: 1
steps:
- name: Setup Ubuntu dependencies
shell: bash
run: sudo apt update && sudo apt install -y protobuf-compiler
- name: Use Nightly with `clippy`
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: clippy,rust-src
- uses: actions/checkout@v4
- name: Rust Cache
uses: swatinem/rust-cache@v2
with:
cache-on-failure: true
cache-all-crates: true
key: check
- name: Annotate with Clippy warnings
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
toolchain: nightly
args: --release --locked --all-features --workspace
test:
needs: lint
runs-on: ubuntu-latest
env:
SKIP_WASM_BUILD: 1
steps:
- name: Setup Ubuntu dependencies
shell: bash
run: sudo apt update && sudo apt install -y protobuf-compiler
- name: Use Nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rust-src
- uses: actions/checkout@v4
- name: Rust Cache
uses: swatinem/rust-cache@v2
with:
cache-on-failure: true
cache-all-crates: true
key: test
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
toolchain: nightly
args: --lib --release --locked --all-features --workspace