|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + workflow_dispatch: |
| 7 | + schedule: |
| 8 | + - cron: '0 0 1 * *' # Monthly |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + |
| 15 | + matrix: |
| 16 | + label: |
| 17 | + - Linux |
| 18 | + - Windows |
| 19 | + - macOS |
| 20 | + |
| 21 | + rust: |
| 22 | + # Should be 1.17.0, but the cargo registry broke backwards compatibility: |
| 23 | + # https://github.com/rust-lang/cargo/issues/14237 |
| 24 | + # |
| 25 | + # It's possible to build on 1.17.0 by removing all serde dependencies and features. |
| 26 | + - 1.19.0 |
| 27 | + - stable |
| 28 | + - beta |
| 29 | + |
| 30 | + include: |
| 31 | + - label: Linux |
| 32 | + os: ubuntu-24.04 |
| 33 | + |
| 34 | + - label: Windows |
| 35 | + os: windows-2022 |
| 36 | + |
| 37 | + - label: macOS |
| 38 | + os: macOS-14 |
| 39 | + |
| 40 | + name: test - ${{ matrix.rust }} - ${{ matrix.label }} |
| 41 | + runs-on: ${{ matrix.os }} |
| 42 | + |
| 43 | + steps: |
| 44 | + - uses: actions/checkout@v4 |
| 45 | + with: |
| 46 | + show-progress: false |
| 47 | + |
| 48 | + - uses: dtolnay/rust-toolchain@master |
| 49 | + with: |
| 50 | + toolchain: ${{ matrix.rust }} |
| 51 | + |
| 52 | + - name: Build |
| 53 | + run: cargo build |
| 54 | + |
| 55 | + - name: Test |
| 56 | + run: cargo test |
| 57 | + |
| 58 | + - name: Build (serde_support) |
| 59 | + if: matrix.rust != '1.19.0' |
| 60 | + run: cargo build --features serde_support |
| 61 | + |
| 62 | + - name: Test (serde_support) |
| 63 | + if: matrix.rust != '1.19.0' |
| 64 | + run: cargo test --features serde_support |
| 65 | + |
| 66 | + - name: Build (serde_support_test) |
| 67 | + if: matrix.rust != '1.19.0' |
| 68 | + run: cargo build --features serde_support_test |
| 69 | + |
| 70 | + - name: Test (serde_support_test) |
| 71 | + if: matrix.rust != '1.19.0' |
| 72 | + run: cargo test --features serde_support_test |
| 73 | + |
| 74 | + clippy: |
| 75 | + runs-on: ubuntu-24.04 |
| 76 | + |
| 77 | + steps: |
| 78 | + - uses: actions/checkout@v4 |
| 79 | + with: |
| 80 | + show-progress: false |
| 81 | + |
| 82 | + - uses: dtolnay/rust-toolchain@stable |
| 83 | + with: |
| 84 | + components: clippy |
| 85 | + |
| 86 | + - name: Run clippy |
| 87 | + run: cargo clippy --all --all-targets |
| 88 | + |
| 89 | + rustfmt: |
| 90 | + runs-on: ubuntu-24.04 |
| 91 | + |
| 92 | + steps: |
| 93 | + - uses: actions/checkout@v4 |
| 94 | + with: |
| 95 | + show-progress: false |
| 96 | + |
| 97 | + - uses: dtolnay/rust-toolchain@stable |
| 98 | + with: |
| 99 | + components: rustfmt |
| 100 | + |
| 101 | + - name: Run rustfmt |
| 102 | + run: cargo fmt --all -- --check |
0 commit comments