-
Notifications
You must be signed in to change notification settings - Fork 15
40 lines (40 loc) · 1.2 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Test
on: [push, pull_request]
jobs:
# Test with a specific version of Go since some tests rely on behavior that
# may drift with versions (e.g., inlining behavior, gofmt behavior, etc.).
test-latest:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.21.x
- name: Checkout code
uses: actions/checkout@v2
- name: Test
run: go test ./...
- name: TestInline
run: go test -v -run=TestInline
env: {TEST_INLINE: true}
- name: Format
run: diff -u <(echo -n) <(gofmt -s -d .)
# Test on a large matrix of Go versions and operating systems.
test-all:
# TODO: GitHub actions are not free on private repositories.
# When this is made public, remove this conditional.
if: github.repository == 'go-json-experiment/json'
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Test
run: go test ./...