Skip to content

bug fixes & updates #21

bug fixes & updates

bug fixes & updates #21

Workflow file for this run

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