bug fixes & updates #21
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust CI | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Rust setup | |
run: rustup toolchain install stable --profile minimal | |
- name: Setup cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.lock') }} | |
- name: Add clippy to the toolchain | |
run: rustup component add clippy | |
- name: Run cargo clippy | |
run: cargo clippy -- -D warnings | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Rust setup | |
run: rustup toolchain install stable --profile minimal | |
- name: Add rustfmt to the toolchain | |
run: rustup component add rustfmt | |
- name: Run cargo format | |
run: cargo fmt --all -- --check | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Rust setup | |
run: rustup toolchain install stable --profile minimal | |
- name: Setup cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.lock') }} | |
- name: Run cargo test | |
run: cargo test --bins -- --nocapture | |
test-realistic: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Rust setup | |
run: rustup toolchain install stable --profile minimal | |
- name: Setup cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
./target/ | |
./test/target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('./test/Cargo.lock') }}-${{ hashFiles('./Cargo.lock') }} | |
- name: Install cargo-interactive-update | |
run: cargo install --path . | |
- name: Run cargo test | |
run: cd test && cargo run | |
audit: | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Rust setup | |
run: rustup toolchain install stable --profile minimal | |
- name: Setup cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-audit | |
- name: Install cargo-audit | |
run: cargo install cargo-audit | |
- name: Run cargo audit | |
run: cargo audit | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Rust setup | |
run: rustup toolchain install stable --profile minimal | |
- name: Setup cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.lock') }} | |
- name: Run cargo check | |
run: cargo check | |
typos: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run typos | |
uses: crate-ci/typos@v1.29.4 |