-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (43 loc) · 1.34 KB
/
test.yml
File metadata and controls
51 lines (43 loc) · 1.34 KB
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
41
42
43
44
45
46
47
48
49
50
51
name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-and-test:
strategy:
matrix:
# Latest two supported releases.
go-version: ['1.25', '1.26']
os: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-14, macos-15, macos-26, windows-2022, windows-2025]
runs-on: ${{ matrix.os }}
steps:
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v5.0.2
with:
go-version: ${{ matrix.go-version }}
- name: Check formatting
if: ${{ matrix.go-version == '1.26' && matrix.os == 'ubuntu-24.04' }}
run: diff -u <(echo -n) <(gofmt -d .)
- name: Check Go modules
if: ${{ matrix.go-version == '1.26' && matrix.os == 'ubuntu-24.04' }}
run: |
go mod tidy -diff
- name: Test (native)
run: go test -v ./...
- name: Build (cross-compile)
if: matrix.os == 'ubuntu-24.04'
run: |
GOOS=darwin go build ./...
GOOS=dragonfly go build ./...
GOOS=freebsd go build ./...
GOOS=linux go build ./...
GOOS=netbsd go build ./...
GOOS=openbsd go build ./...
GOOS=solaris go build ./...
GOOS=windows go build ./...