| 1 |
on: |
| 2 |
push: |
| 3 |
branches: |
| 4 |
- master |
| 5 |
pull_request: |
| 6 |
branches: |
| 7 |
- '**' |
| 8 |
name: Test |
| 9 |
jobs: |
| 10 |
test: |
| 11 |
strategy: |
| 12 |
fail-fast: false |
| 13 |
matrix: |
| 14 |
go-version: |
| 15 |
- '1.25.x' |
| 16 |
- '1.26.x' |
| 17 |
os: |
| 18 |
- ubuntu-latest |
| 19 |
- macos-latest |
| 20 |
- windows-latest |
| 21 |
runs-on: ${{ matrix.os }} |
| 22 |
steps: |
| 23 |
- name: Checkout code |
| 24 |
uses: actions/checkout@v5 |
| 25 |
- name: Install Go |
| 26 |
uses: actions/setup-go@v5 |
| 27 |
with: |
| 28 |
go-version: ${{ matrix.go-version }} |
| 29 |
cache: false |
| 30 |
- name: Test |
| 31 |
run: | |
| 32 |
go test ./... |
| 33 |
go test -race ./... |
| 34 |
|
| 35 |
- name: Tidy |
| 36 |
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.26.x' |
| 37 |
run: | |
| 38 |
go mod tidy |
| 39 |
|
| 40 |
test -z "$(gofmt -d .)" || (gofmt -d . && false) |
| 41 |
test -z "$(git status --porcelain)" || (git status; git diff && false) |