fix: replace implicit format captures for Rust 1.56 compatibility #9
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: | |
| push: | |
| branches: [main, master, dev] | |
| pull_request: | |
| # Cancel any in-progress run on the same branch when a new push arrives. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| CARGO_INCREMENTAL: 0 # no incremental cache in CI — fresh builds only | |
| CARGO_NET_RETRY: 10 # retry on flaky network | |
| RUSTUP_MAX_RETRIES: 10 | |
| jobs: | |
| test: | |
| name: Test (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-on-failure: true # cache even failed builds so retries are fast | |
| - run: cargo test --all-features | |
| - run: cargo run --example smoke | |
| msrv: | |
| name: MSRV (1.56) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: "1.56" | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-on-failure: true | |
| # Cargo resolves dev-dependencies even for `cargo check --lib`, and | |
| # image 0.25 requires Rust 1.73+. Strip dev-deps before checking so | |
| # the resolver only sees what library consumers actually depend on. | |
| - name: Remove dev-dependencies | |
| run: | | |
| python3 -c " | |
| import re, pathlib | |
| t = pathlib.Path('Cargo.toml') | |
| t.write_text(re.sub(r'\[dev-dependencies\].*', '', t.read_text(), flags=re.DOTALL)) | |
| " | |
| - run: cargo check --lib | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-on-failure: true | |
| - run: cargo clippy --all-targets --all-features -- -D warnings | |
| fmt: | |
| name: Rustfmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| # No cache — rustfmt never compiles, so caching adds overhead with no gain. | |
| - run: cargo fmt --check | |
| doc: | |
| name: Docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-on-failure: true | |
| - run: cargo doc --no-deps --document-private-items | |
| env: | |
| RUSTDOCFLAGS: -D warnings |