| 1 | name: CI |
| 2 | |
| 3 | on: |
| 4 | workflow_dispatch: |
| 5 | push: |
| 6 | branches: [ master ] |
| 7 | pull_request: |
| 8 | branches: [ master ] |
| 9 | |
| 10 | env: |
| 11 | CARGO_TERM_COLOR: always |
| 12 | |
| 13 | jobs: |
| 14 | build: |
| 15 | name: ${{ matrix.rust }} |
| 16 | runs-on: ubuntu-latest |
| 17 | strategy: |
| 18 | fail-fast: false |
| 19 | matrix: |
| 20 | rust: |
| 21 | - 1.31.0 |
| 22 | - stable |
| 23 | - beta |
| 24 | - nightly |
| 25 | steps: |
| 26 | - uses: actions/checkout@v4 |
| 27 | - uses: dtolnay/rust-toolchain@master |
| 28 | with: |
| 29 | toolchain: ${{ matrix.rust }} |
| 30 | - name: Use MSRV Cargo.lock |
| 31 | run: cp Cargo.lock.msrv Cargo.lock |
| 32 | if: matrix.rust == '1.31.0' |
| 33 | - name: cargo fmt --all -- --check |
| 34 | run: | |
| 35 | rustup component add rustfmt-preview |
| 36 | cargo fmt --all -- --check |
| 37 | if: matrix.rust == 'stable' |
| 38 | - run: | |
| 39 | cargo build --verbose |
| 40 | - run: | |
| 41 | cargo test --verbose |