-
Notifications
You must be signed in to change notification settings - Fork 23
99 lines (82 loc) · 2.59 KB
/
golang.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Go
on:
push:
branches: [ v* ]
pull_request:
branches: [ v* ]
jobs:
# Test
tests:
name: Test go${{ matrix.go }} on ${{ matrix.os }}
strategy:
matrix:
os:
- 'ubuntu-latest'
- 'macos-latest'
- 'windows-latest'
go:
- '1.19'
- '1.20'
- '1.21'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- run: go test -v -race ./...
# Lint
# lint:
# name: Lint go${{ matrix.go }}
#
# strategy:
# matrix:
# go:
# - 1.16
# - 1.17
# - 1.18
#
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-go@v2
# with:
# go-version: ${{ matrix.go }}
# - uses: golangci/golangci-lint-action@v2
# with:
# version: v1.45
# Build
build:
name: Build ${{ matrix.goos }}/${{ matrix.goarch }} on ${{ matrix.os }}
strategy:
matrix:
# `go tool dist list` with many exclusions
include:
- { os: ubuntu-latest, goos: linux, goarch: amd64, cgo: '0' }
- { os: ubuntu-latest, goos: linux, goarch: arm64, cgo: '0' }
- { os: ubuntu-latest, goos: linux, goarch: ppc64le, cgo: '0' }
- { os: ubuntu-latest, goos: android, goarch: amd64, cgo: '0' }
- { os: ubuntu-latest, goos: android, goarch: arm64, cgo: '0' }
- { os: ubuntu-latest, goos: freebsd, goarch: amd64, cgo: '0' }
- { os: ubuntu-latest, goos: freebsd, goarch: arm64, cgo: '0' }
- { os: ubuntu-latest, goos: openbsd, goarch: amd64, cgo: '0' }
- { os: ubuntu-latest, goos: openbsd, goarch: arm64, cgo: '0' }
# MacOS IOKit required, so no cross-build available
# - { os: ubuntu-latest, goos: darwin, goarch: amd64 }
# - { os: ubuntu-latest, goos: darwin, goarch: arm64 }
- { os: macos-latest, goos: darwin, goarch: amd64, cgo: '1' }
- { os: macos-latest, goos: darwin, goarch: arm64, cgo: '1' }
- { os: windows-latest, goos: windows, goarch: amd64, cgo: '0' }
- { os: windows-latest, goos: windows, goarch: arm64, cgo: '0' }
runs-on: ${{ matrix.os }}
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: ${{ matrix.cgo }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- run: uname -a && go build