|
| 1 | +name: CI |
| 2 | + |
| 3 | +env: |
| 4 | + CARGO_TERM_COLOR: always |
| 5 | + RUST_TOOLCHAIN: stable |
| 6 | + RUST_TOOLCHAIN_MSRV: 1.85.0 |
| 7 | + |
| 8 | +on: |
| 9 | + push: |
| 10 | + branches: |
| 11 | + - main |
| 12 | + pull_request: {} |
| 13 | + |
| 14 | +jobs: |
| 15 | + check: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + - uses: dtolnay/rust-toolchain@stable |
| 20 | + with: |
| 21 | + toolchain: ${{env.RUST_TOOLCHAIN}} |
| 22 | + components: clippy, rustfmt |
| 23 | + - uses: Swatinem/rust-cache@v2 |
| 24 | + - name: check |
| 25 | + run: | |
| 26 | + make check |
| 27 | + - name: clippy |
| 28 | + run: | |
| 29 | + make clippy |
| 30 | + - name: rustfmt |
| 31 | + run: | |
| 32 | + make fmt-check |
| 33 | +
|
| 34 | + test: |
| 35 | + needs: [check, check-all-features] |
| 36 | + runs-on: ubuntu-latest |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v4 |
| 39 | + - uses: dtolnay/rust-toolchain@stable |
| 40 | + with: |
| 41 | + toolchain: ${{env.RUST_TOOLCHAIN}} |
| 42 | + - uses: Swatinem/rust-cache@v2 |
| 43 | + - name: Run tests |
| 44 | + run: make test |
| 45 | + |
| 46 | + test-macos: |
| 47 | + needs: [check, check-all-features] |
| 48 | + runs-on: macos-latest |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v4 |
| 51 | + - uses: dtolnay/rust-toolchain@stable |
| 52 | + with: |
| 53 | + toolchain: ${{env.RUST_TOOLCHAIN}} |
| 54 | + - uses: Swatinem/rust-cache@v2 |
| 55 | + - name: Run tests |
| 56 | + run: make test |
| 57 | + |
| 58 | + cargo-hack: |
| 59 | + needs: [check, check-all-features] |
| 60 | + runs-on: ubuntu-latest |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@v4 |
| 63 | + - uses: dtolnay/rust-toolchain@stable |
| 64 | + with: |
| 65 | + toolchain: ${{env.RUST_TOOLCHAIN}} |
| 66 | + - name: install cargo-hack |
| 67 | + uses: taiki-e/install-action@cargo-hack |
| 68 | + - name: cargo hack check |
| 69 | + run: make hack |
| 70 | + |
| 71 | + dependencies-are-sorted: |
| 72 | + needs: [check, check-all-features] |
| 73 | + runs-on: ubuntu-latest |
| 74 | + steps: |
| 75 | + - uses: actions/checkout@v4 |
| 76 | + - uses: dtolnay/rust-toolchain@stable |
| 77 | + with: |
| 78 | + toolchain: ${{env.RUST_TOOLCHAIN}} |
| 79 | + - uses: Swatinem/rust-cache@v2 |
| 80 | + - name: Install cargo-sort |
| 81 | + run: | |
| 82 | + cargo install cargo-sort |
| 83 | + - name: Check dependency tables |
| 84 | + working-directory: . |
| 85 | + run: | |
| 86 | + make sort-check |
0 commit comments