Merge pull request #119 from bartvdbraak/version-3 #230
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: Checks | |
on: | |
push: | |
branches: [ main ] | |
paths: [ 'src/**', 'Cargo.toml', 'Cargo.lock' ] | |
pull_request: | |
branches: [ main ] | |
paths: [ 'src/**', 'Cargo.toml', 'Cargo.lock' ] | |
jobs: | |
fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- id: fmt | |
name: Format code with rustfmt | |
run: | | |
cargo fmt --all -- --check | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Lint code with clippy | |
run: cargo clippy --all -- --deny warnings | |
audit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo-audit | |
run: cargo install cargo-audit | |
- name: Check for known vulnerabilities with cargo-audit | |
run: cargo audit | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Run unit tests | |
run: cargo test --bins | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Build project | |
run: cargo build --all --release |