| 1 |
name: Go Tests |
| 2 |
on: |
| 3 |
push: |
| 4 |
|
| 5 |
permissions: |
| 6 |
contents: read |
| 7 |
|
| 8 |
jobs: |
| 9 |
define-runners: |
| 10 |
runs-on: ubuntu-latest |
| 11 |
outputs: |
| 12 |
runners: '{"linux":"ubuntu-latest", "macos":"macos-latest", "windows":"windows-latest"}' |
| 13 |
steps: |
| 14 |
- run: true # no-op |
| 15 |
|
| 16 |
test: |
| 17 |
needs: [define-runners] |
| 18 |
strategy: |
| 19 |
matrix: |
| 20 |
go-version: |
| 21 |
- '1.24' # oldest supported; named in go.mod |
| 22 |
- 'oldstable' |
| 23 |
- 'stable' |
| 24 |
os: |
| 25 |
- 'linux' |
| 26 |
- 'macos' |
| 27 |
- 'windows' |
| 28 |
runs-on: ${{ fromJSON(needs.define-runners.outputs.runners)[ matrix.os ] }} |
| 29 |
steps: |
| 30 |
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 31 |
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 |
| 32 |
with: |
| 33 |
go-version: ${{ matrix.go-version }} |
| 34 |
- run: go test ./... |