|
| 1 | +name: CI |
| 2 | +env: |
| 3 | + CI: true |
| 4 | + |
| 5 | +permissions: |
| 6 | + contents: read |
| 7 | + |
| 8 | +on: |
| 9 | + pull_request: |
| 10 | + push: |
| 11 | + branches: |
| 12 | + - main |
| 13 | + paths-ignore: |
| 14 | + - '**.md' |
| 15 | +concurrency: |
| 16 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 17 | + cancel-in-progress: true |
| 18 | + |
| 19 | +jobs: |
| 20 | + test: |
| 21 | + runs-on: ubuntu-latest |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 24 | + - uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921 |
| 25 | + with: |
| 26 | + toolchain: stable |
| 27 | + |
| 28 | + - name: Run tests |
| 29 | + run: cargo test --locked --all-features --workspace |
| 30 | + |
| 31 | + lint: |
| 32 | + runs-on: ubuntu-latest |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 |
| 35 | + - uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921 |
| 36 | + with: |
| 37 | + toolchain: stable |
| 38 | + components: rustfmt,clippy |
| 39 | + |
| 40 | + - name: Format |
| 41 | + run: cargo fmt --all -- --check |
| 42 | + |
| 43 | + - name: Lint |
| 44 | + run: cargo clippy --all-targets --all-features -- -D warnings |
| 45 | + |
| 46 | + coverage: |
| 47 | + runs-on: ubuntu-latest |
| 48 | + continue-on-error: true |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 |
| 51 | + - uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921 |
| 52 | + with: |
| 53 | + toolchain: stable |
| 54 | + components: llvm-tools-preview |
| 55 | + |
| 56 | + - name: Install cargo-llvm-cov |
| 57 | + uses: taiki-e/install-action@0e09747a63ae497bf945b3dcaf38fef0050d0109 # v2.62.0 |
| 58 | + with: |
| 59 | + tool: cargo-llvm-cov |
| 60 | + |
| 61 | + - name: Generate code coverage |
| 62 | + run: cargo llvm-cov --locked --all-features --workspace --lcov --output-path lcov.info |
| 63 | + |
| 64 | + - name: Upload coverage to Codecov |
| 65 | + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 #v5.5.1 |
| 66 | + with: |
| 67 | + files: lcov.info |
| 68 | + fail_ci_if_error: true |
| 69 | + |
| 70 | + cargo-machete: |
| 71 | + runs-on: ubuntu-latest |
| 72 | + steps: |
| 73 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 |
| 74 | + - uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921 |
| 75 | + with: |
| 76 | + toolchain: stable |
| 77 | + |
| 78 | + - name: Install cargo-machete |
| 79 | + uses: taiki-e/install-action@0e09747a63ae497bf945b3dcaf38fef0050d0109 |
| 80 | + with: |
| 81 | + tool: cargo-machete |
| 82 | + |
| 83 | + - name: Run cargo machete |
| 84 | + run: cargo machete |
0 commit comments