| 1 | name: Run tests |
| 2 | on: pull_request |
| 3 | env: |
| 4 | CLICOLOR_FORCE: 1 |
| 5 | COLORTERM: "truecolor" |
| 6 | |
| 7 | jobs: |
| 8 | cargo-fmt: |
| 9 | name: cargo-fmt@stable |
| 10 | runs-on: ubuntu-latest |
| 11 | steps: |
| 12 | - name: Checkout repository |
| 13 | uses: actions/checkout@v4 |
| 14 | - name: Install Rust stable |
| 15 | uses: dtolnay/rust-toolchain@master |
| 16 | with: |
| 17 | toolchain: stable |
| 18 | components: rustfmt |
| 19 | - name: Run formatting checks |
| 20 | run: cargo fmt --check |
| 21 | |
| 22 | cargo-clippy: |
| 23 | name: "${{ matrix.os }}:cargo-clippy@stable" |
| 24 | runs-on: "${{ matrix.os }}-latest" |
| 25 | strategy: |
| 26 | matrix: |
| 27 | os: ["ubuntu", "windows", "macos"] |
| 28 | steps: |
| 29 | - name: Checkout repository |
| 30 | uses: actions/checkout@v4 |
| 31 | - name: Install Rust stable |
| 32 | uses: dtolnay/rust-toolchain@master |
| 33 | with: |
| 34 | toolchain: stable |
| 35 | components: clippy |
| 36 | - name: Run clippy checks |
| 37 | run: cargo clippy --all-features -- -D warnings |
| 38 | |
| 39 | cargo-test: |
| 40 | name: "${{ matrix.os }}:cargo-test@${{ matrix.version }}" |
| 41 | runs-on: "${{ matrix.os }}-latest" |
| 42 | strategy: |
| 43 | matrix: |
| 44 | os: ["ubuntu", "windows", "macos"] |
| 45 | version: ["stable", "beta", "1.80"] |
| 46 | steps: |
| 47 | - name: Checkout repository |
| 48 | uses: actions/checkout@v4 |
| 49 | - name: Install Rust ${{ matrix.version }} |
| 50 | uses: dtolnay/rust-toolchain@master |
| 51 | with: |
| 52 | toolchain: ${{ matrix.version }} |
| 53 | - name: Run tests |
| 54 | run: cargo test |
| 55 | |
| 56 | check-semver: |
| 57 | name: Check semver compatibility |
| 58 | if: github.base_ref == 'master' |
| 59 | runs-on: ubuntu-latest |
| 60 | steps: |
| 61 | - name: Checkout repository |
| 62 | uses: actions/checkout@v4 |
| 63 | - name: Check semver |
| 64 | uses: obi1kenobi/cargo-semver-checks-action@v2 |