|
| 1 | +name: CI |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | +env: |
| 8 | + MSRV: "1.70" |
| 9 | +jobs: |
| 10 | + check: |
| 11 | + name: Check |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + toolchain: |
| 15 | + - MSRV |
| 16 | + - stable |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - name: Checkout sources |
| 20 | + uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - name: Install toolchain |
| 23 | + uses: dtolnay/rust-toolchain@master |
| 24 | + with: |
| 25 | + toolchain: ${{ matrix.toolchain == 'MSRV' && env.MSRV || 'stable' }} |
| 26 | + |
| 27 | + - uses: Swatinem/rust-cache@v2 |
| 28 | + |
| 29 | + - name: Run cargo check |
| 30 | + run: | |
| 31 | + rustc --version |
| 32 | + cargo check |
| 33 | +
|
| 34 | + test: |
| 35 | + name: Test |
| 36 | + runs-on: ${{ matrix.os }} |
| 37 | + strategy: |
| 38 | + matrix: |
| 39 | + os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm] |
| 40 | + steps: |
| 41 | + - name: Checkout sources |
| 42 | + uses: actions/checkout@v4 |
| 43 | + |
| 44 | + - name: Install MSRV toolchain |
| 45 | + uses: dtolnay/rust-toolchain@master |
| 46 | + with: |
| 47 | + toolchain: "${{ env.MSRV }}" |
| 48 | + |
| 49 | + - uses: Swatinem/rust-cache@v2 |
| 50 | + |
| 51 | + - name: Check rust version |
| 52 | + run: rustc --version |
| 53 | + |
| 54 | + - name: Run cargo test |
| 55 | + run: cargo test |
| 56 | + |
| 57 | + lints: |
| 58 | + name: Lints |
| 59 | + runs-on: ${{ matrix.os }} |
| 60 | + strategy: |
| 61 | + matrix: |
| 62 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 63 | + steps: |
| 64 | + - name: Checkout sources |
| 65 | + uses: actions/checkout@v4 |
| 66 | + |
| 67 | + - name: Install MSRV toolchain |
| 68 | + uses: dtolnay/rust-toolchain@master |
| 69 | + with: |
| 70 | + toolchain: "${{ env.MSRV }}" |
| 71 | + components: rustfmt, clippy |
| 72 | + |
| 73 | + - uses: Swatinem/rust-cache@v2 |
| 74 | + |
| 75 | + - name: Check rust version |
| 76 | + run: rustc --version |
| 77 | + |
| 78 | + - name: Run cargo fmt |
| 79 | + run: cargo fmt --check |
| 80 | + |
| 81 | + - name: Run cargo clippy |
| 82 | + run: cargo clippy -- -D warnings |
| 83 | + |
| 84 | + - name: Run cargo doc |
| 85 | + run: cargo doc --no-deps --document-private-items |
| 86 | + env: |
| 87 | + RUSTDOCFLAGS: -D warnings |
0 commit comments