|
| 1 | +permissions: |
| 2 | + contents: read |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | +name: check |
| 8 | +jobs: |
| 9 | + fmt: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + name: stable / fmt |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + with: |
| 15 | + submodules: true |
| 16 | + - name: Install stable |
| 17 | + uses: dtolnay/rust-toolchain@stable |
| 18 | + with: |
| 19 | + components: rustfmt |
| 20 | + - name: cargo fmt --check |
| 21 | + run: cargo fmt --check |
| 22 | + - name: install taplo-cli |
| 23 | + run: cargo install taplo-cli --locked |
| 24 | + - name: taplo fmt --check |
| 25 | + run: find . -type f -iname "*.toml" -print0 | xargs -0 taplo format --check |
| 26 | + clippy: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + name: ${{ matrix.toolchain }} / clippy |
| 29 | + permissions: |
| 30 | + contents: read |
| 31 | + checks: write |
| 32 | + strategy: |
| 33 | + fail-fast: false |
| 34 | + matrix: |
| 35 | + toolchain: [stable, beta] |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v4 |
| 38 | + with: |
| 39 | + submodules: true |
| 40 | + - name: Install ${{ matrix.toolchain }} |
| 41 | + uses: dtolnay/rust-toolchain@master |
| 42 | + with: |
| 43 | + toolchain: ${{ matrix.toolchain }} |
| 44 | + components: clippy |
| 45 | + - name: cargo clippy |
| 46 | + uses: actions-rs/clippy-check@v1 |
| 47 | + with: |
| 48 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 49 | + args: --all-features -- -D warnings |
| 50 | + doc: |
| 51 | + runs-on: ubuntu-latest |
| 52 | + name: nightly / doc |
| 53 | + steps: |
| 54 | + - uses: actions/checkout@v4 |
| 55 | + with: |
| 56 | + submodules: true |
| 57 | + - name: Install nightly |
| 58 | + uses: dtolnay/rust-toolchain@nightly |
| 59 | + - name: cargo doc |
| 60 | + run: cargo doc --no-deps --lib --all-features |
| 61 | + env: |
| 62 | + RUSTDOCFLAGS: --cfg docsrs |
| 63 | + hack: |
| 64 | + runs-on: ubuntu-latest |
| 65 | + name: ubuntu / stable / features |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v4 |
| 68 | + with: |
| 69 | + submodules: true |
| 70 | + - name: Install stable |
| 71 | + uses: dtolnay/rust-toolchain@stable |
| 72 | + - name: cargo install cargo-hack |
| 73 | + uses: taiki-e/install-action@cargo-hack |
| 74 | + - name: cargo hack |
| 75 | + run: cargo hack --feature-powerset check --lib --tests |
| 76 | + msrv: |
| 77 | + runs-on: ubuntu-latest |
| 78 | + # we use a matrix here just because env can't be used in job names |
| 79 | + # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability |
| 80 | + strategy: |
| 81 | + matrix: |
| 82 | + msrv: [1.72.0] # cosmrs v0.15.0 requires 1.72.0 or newer |
| 83 | + name: ubuntu / ${{ matrix.msrv }} |
| 84 | + steps: |
| 85 | + - uses: actions/checkout@v4 |
| 86 | + with: |
| 87 | + submodules: true |
| 88 | + - name: Install ${{ matrix.msrv }} |
| 89 | + uses: dtolnay/rust-toolchain@master |
| 90 | + with: |
| 91 | + toolchain: ${{ matrix.msrv }} |
| 92 | + - name: cargo +${{ matrix.msrv }} check |
| 93 | + run: cargo check |
0 commit comments