Minimal CI #3
This file contains hidden or 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: Lint, Build and Test | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust (stable) with components | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - name: Cache cargo registry and build | |
| uses: Swatinem/rust-cache@v2 | |
| - name: rustfmt check | |
| run: cargo fmt --all -- --check | |
| - name: clippy (deny warnings) | |
| run: | | |
| cargo clippy --all-targets --all-features -- -D warnings | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust (stable) with components | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo registry and build | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Cargo Build | |
| run: cargo build --verbose | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust (stable) with components | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo registry and build | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run tests | |
| run: cargo test --all-features --verbose |