| 1 |
name: Test |
| 2 |
on: [push, pull_request] |
| 3 |
jobs: |
| 4 |
# Test with a specific version of Go since some tests rely on behavior that |
| 5 |
# may drift with versions (e.g., inlining behavior, gofmt behavior, etc.). |
| 6 |
test-latest: |
| 7 |
runs-on: ubuntu-latest |
| 8 |
steps: |
| 9 |
- name: Install Go |
| 10 |
uses: actions/setup-go@v5 |
| 11 |
with: |
| 12 |
go-version: 1.26.x |
| 13 |
- name: Checkout code |
| 14 |
uses: actions/checkout@v4 |
| 15 |
- name: Test |
| 16 |
run: go test ./... |
| 17 |
- name: Test386 |
| 18 |
run: go test ./... |
| 19 |
env: {GOARCH: "386"} |
| 20 |
- name: BuildJSONv2 |
| 21 |
run: go build -tags=goexperiment.jsonv2 ./... |
| 22 |
- name: TestInline |
| 23 |
run: go test -v -run=TestInline |
| 24 |
env: {TEST_INLINE: true} |
| 25 |
- name: Format |
| 26 |
run: diff -u <(echo -n) <(gofmt -s -d .) |
| 27 |
# Test on a large matrix of Go versions and operating systems. |
| 28 |
test-all: |
| 29 |
strategy: |
| 30 |
matrix: |
| 31 |
go-version: [1.26.x] |
| 32 |
os: [ubuntu-latest, macos-latest, windows-latest] |
| 33 |
runs-on: ${{ matrix.os }} |
| 34 |
steps: |
| 35 |
- name: Install Go |
| 36 |
uses: actions/setup-go@v5 |
| 37 |
with: |
| 38 |
go-version: ${{ matrix.go-version }} |
| 39 |
- name: Checkout code |
| 40 |
uses: actions/checkout@v4 |
| 41 |
- name: Test |
| 42 |
run: go test ./... |