Add binary tests #211
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: Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: {} | |
jobs: | |
test: | |
name: "Tests" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup build cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Setup buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Cargo check | |
run: cargo check --all-features | |
- name: Build test containers | |
run: scripts/build_containers.sh | |
- name: Run tests | |
run: cargo test | |
coverage: | |
name: "Code coverage" | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Restore build cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Setup buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install helpers | |
run: sudo apt install kcov jq | |
- name: Build test containers | |
run: scripts/build_containers.sh | |
- name: Run tests | |
run: scripts/kcov-coverage.sh | |
- name: Upload code coverage | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true | |
lint: | |
name: "Lints" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Restore build cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt, clippy | |
- name: Clippy | |
run: cargo clippy --all-features -- --deny "warnings" | |
- name: Rustfmt | |
run: cargo fmt --check | |
- name: Check for unused dependencies | |
uses: bnjbvr/cargo-machete@main |