-
Notifications
You must be signed in to change notification settings - Fork 54
77 lines (74 loc) · 2.54 KB
/
go.yml
File metadata and controls
77 lines (74 loc) · 2.54 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
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
on:
push:
branches: [ main ]
pull_request:
branches: [ '**' ]
# Set default permissions as read only.
permissions: read-all
name: Go
jobs:
go-test:
strategy:
matrix:
go-version: [1.15.x, 1.25.x, 1.26.x ]
platform: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
exclude:
# There is no arm64 version of Go for darwin.
# This exclude can be removed if the minimal Go version
# is > Go 1.16.
- go-version: "1.15.x"
platform: "macos-latest"
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version: ${{ matrix.go-version }}
- name: Download Go dependencies
env:
GOPROXY: "https://proxy.golang.org"
run: go mod download
- name: Simple Tests
if: matrix.platform != 'ubuntu-latest'
run: go test -count=1 ./...
- name: Test with -race
if: matrix.platform == 'ubuntu-latest'
run: go test -race -count=3 ./...
- name: Test with -shuffle=on
if: matrix.platform == 'ubuntu-latest' && startsWith(matrix.go-version, '1.2')
run: go test -shuffle=on -count=3 ./...
- name: Integrationtest for linux
if: matrix.platform == 'ubuntu-latest'
run: |
go test -race -v -exec=sudo -tags integration -covermode=atomic -coverprofile=profile.cov ./...
- name: coveralls.io
if: matrix.platform == 'ubuntu-latest' && startsWith(matrix.go-version, '1.26')
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go install github.com/mattn/goveralls@v0.0.12
goveralls -v -tags integration -coverprofile=profile.cov -service=github
code-check:
strategy:
matrix:
go-version: [1.26.x]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version: ${{ matrix.go-version }}
- name: Download Go dependencies
env:
GOPROXY: "https://proxy.golang.org"
run: go mod download
- name: staticcheck.io
uses: dominikh/staticcheck-action@9716614d4101e79b4340dd97b10e54d68234e431 # v1.4.1
with:
version: "2026.1"
install-go: false
cache-key: ${{ matrix.go }}