-
Notifications
You must be signed in to change notification settings - Fork 48
81 lines (78 loc) · 2.47 KB
/
go.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
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.13.x, 1.21.x, 1.22.x, 1.23.x]
platform: [ubuntu-latest, 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.13.x"
platform: "macos-latest"
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
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.23')
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go install github.com/mattn/[email protected]
goveralls -v -tags integration -coverprofile=profile.cov -service=github
code-check:
strategy:
matrix:
go-version: [1.23.x]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Download Go dependencies
env:
GOPROXY: "https://proxy.golang.org"
run: go mod download
- name: golint
run: |
go install golang.org/x/lint/golint@latest
$(go env GOPATH)/bin/golint $(go list ./... | grep -v internal/unix)
- name: staticcheck.io
uses: dominikh/[email protected]
with:
version: "2024.1.1"
install-go: false
cache-key: ${{ matrix.go }}