| 1 | name: Rust |
| 2 | on: |
| 3 | push: |
| 4 | branches: [main] |
| 5 | pull_request: |
| 6 | env: |
| 7 | CARGO_TERM_COLOR: always |
| 8 | RUSTFLAGS: -D warnings |
| 9 | jobs: |
| 10 | test: |
| 11 | name: Test (${{ matrix.toolchain }}) |
| 12 | runs-on: ubuntu-latest |
| 13 | strategy: |
| 14 | fail-fast: false |
| 15 | matrix: |
| 16 | toolchain: [stable, beta, nightly] |
| 17 | include: |
| 18 | - toolchain: nightly |
| 19 | experimental: true |
| 20 | continue-on-error: ${{ matrix.experimental == true }} |
| 21 | steps: |
| 22 | - uses: actions/checkout@v4 |
| 23 | - uses: dtolnay/rust-toolchain@master |
| 24 | with: |
| 25 | toolchain: ${{ matrix.toolchain }} |
| 26 | components: clippy, rustfmt |
| 27 | - uses: Swatinem/rust-cache@v2 |
| 28 | - run: cargo fmt --all -- --check |
| 29 | - run: cargo clippy --all-targets |
| 30 | - run: cargo test --all-features |