Slim dependencies and ship a batteries-included default binary #27
Workflow file for this run
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| # Cancel superseded runs on the same ref (a new push/PR sync) to save runners. | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| # Incremental compilation bloats the cache and buys nothing in CI's cold builds. | |
| CARGO_INCREMENTAL: "0" | |
| jobs: | |
| fmt: | |
| name: Rustfmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Installs the toolchain + components pinned in rust-toolchain.toml. | |
| - name: Install Rust toolchain | |
| run: rustup show active-toolchain || rustup toolchain install | |
| - run: cargo fmt --all -- --check | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| run: rustup show active-toolchain || rustup toolchain install | |
| - name: Install Protoc | |
| uses: arduino/setup-protoc@v3 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: ci-clippy | |
| # Restore on every run, but only write the cache from main so PRs can't | |
| # pollute it and we stay within the repo's 10 GB cache budget. | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - run: cargo clippy --all-features --all-targets -- -D warnings | |
| test: | |
| name: Test Suite | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| run: rustup show active-toolchain || rustup toolchain install | |
| - name: Install Protoc | |
| uses: arduino/setup-protoc@v3 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: ci-test | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - run: cargo test --all-features --locked | |
| check: | |
| name: Check (windows) | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| run: rustup show active-toolchain || rustup toolchain install | |
| - name: Install Protoc | |
| uses: arduino/setup-protoc@v3 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: ci-check-windows | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - run: cargo check --all-features --locked |