| 1 | name: Run CI |
| 2 | |
| 3 | on: |
| 4 | pull_request: |
| 5 | push: |
| 6 | branches: |
| 7 | - 'main' |
| 8 | |
| 9 | concurrency: |
| 10 | group: test-${{ github.ref_name }} |
| 11 | cancel-in-progress: true |
| 12 | |
| 13 | jobs: |
| 14 | lint: |
| 15 | runs-on: ubuntu-latest |
| 16 | timeout-minutes: 5 |
| 17 | |
| 18 | steps: |
| 19 | - name: Checkout project |
| 20 | uses: actions/checkout@v4 |
| 21 | |
| 22 | - name: Setup Rust |
| 23 | uses: caido/action-setup-rust@v1 |
| 24 | with: |
| 25 | cache: false |
| 26 | |
| 27 | - name: Run linter |
| 28 | uses: giraffate/clippy-action@871cc4173f2594435c7ea6b0bce499cf6c2164a1 |
| 29 | with: |
| 30 | github_token: ${{ secrets.GITHUB_TOKEN }} |
| 31 | clippy_flags: --all-features -- -D warnings |
| 32 | reporter: github-pr-review |
| 33 | |
| 34 | - name: Run formatter |
| 35 | run: cargo fmt --all -- --check |
| 36 | |
| 37 | test: |
| 38 | needs: lint |
| 39 | runs-on: ${{ matrix.os }} |
| 40 | timeout-minutes: 10 |
| 41 | |
| 42 | strategy: |
| 43 | matrix: |
| 44 | os: [ubuntu-latest, windows-latest] |
| 45 | |
| 46 | steps: |
| 47 | - name: Checkout project |
| 48 | uses: actions/checkout@v4 |
| 49 | |
| 50 | - name: Setup Rust |
| 51 | uses: caido/action-setup-rust@v1 |
| 52 | with: |
| 53 | cache: false |
| 54 | |
| 55 | - name: Run tests |
| 56 | run: cargo test |