| 1 | name: Run tests |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - main |
| 7 | tags: |
| 8 | - v3.* |
| 9 | pull_request: |
| 10 | branches: |
| 11 | - main |
| 12 | |
| 13 | permissions: |
| 14 | contents: read |
| 15 | |
| 16 | jobs: |
| 17 | test: |
| 18 | strategy: |
| 19 | matrix: |
| 20 | os: [ubuntu-24.04, macos-15, windows-2025] |
| 21 | go: [stable, oldstable] |
| 22 | |
| 23 | name: ${{ matrix.os }} @ Go ${{ matrix.go }} |
| 24 | runs-on: ${{ matrix.os }} |
| 25 | |
| 26 | steps: |
| 27 | - uses: actions/checkout@v7 |
| 28 | |
| 29 | - name: Set up Go |
| 30 | uses: actions/setup-go@v6 |
| 31 | with: |
| 32 | go-version: ${{ matrix.go }} |
| 33 | |
| 34 | - name: Set PATH |
| 35 | run: echo "${GITHUB_WORKSPACE}/.local/bin" >>"${GITHUB_PATH}" |
| 36 | |
| 37 | - if: matrix.go == 'stable' && matrix.os == 'ubuntu-24.04' |
| 38 | run: make ensure-goimports |
| 39 | |
| 40 | - if: matrix.go == 'stable' && matrix.os == 'ubuntu-24.04' |
| 41 | run: make lint |
| 42 | |
| 43 | - run: make vet |
| 44 | - run: make test |
| 45 | - run: make check-binary-size |
| 46 | |
| 47 | - if: matrix.go == 'stable' && matrix.os == 'ubuntu-24.04' |
| 48 | run: make generate |
| 49 | |
| 50 | - run: make diffcheck |
| 51 | |
| 52 | - if: matrix.go == 'stable' && matrix.os == 'ubuntu-24.04' |
| 53 | run: make v3diff |
| 54 | |
| 55 | - if: success() && matrix.go == 'stable' && matrix.os == 'ubuntu-24.04' |
| 56 | uses: codecov/codecov-action@v7 |
| 57 | with: |
| 58 | token: ${{ secrets.CODECOV_TOKEN }} |
| 59 | fail_ci_if_error: true |
| 60 | verbose: true |