-
Notifications
You must be signed in to change notification settings - Fork 9
63 lines (58 loc) · 2.09 KB
/
ci.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
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
strategy:
matrix:
go-version: [1.21.x, 1.22.x, tip]
full-tests: [false]
include:
- go-version: 1.23.x
full-tests: true
runs-on: ubuntu-latest
steps:
- name: Setup go
run: |
curl -sL https://raw.githubusercontent.com/maxatome/install-go/v3.6/install-go.pl |
perl - ${{ matrix.go-version }} $HOME/go
- name: Checkout code
uses: actions/checkout@v2
- name: Linting
if: matrix.full-tests
run: |
curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh |
sh -s -- -b $HOME/go/bin v1.61.0
echo $PATH
$HOME/go/bin/golangci-lint run --max-issues-per-linter 0 \
--max-same-issues 0 \
-E asciicheck \
-E bidichk \
-E durationcheck \
-E gocritic \
-E godot \
-E goimports \
-E misspell \
-E prealloc \
-E revive \
-E unconvert \
-E whitespace \
./...
- name: Testing
continue-on-error: ${{ matrix.go-version == 'tip' }}
run: |
go version
if [ ${{ matrix.full-tests }} = true ]; then
GO_TEST_FLAGS="-covermode=atomic -coverprofile=coverage.out"
fi
go test $GO_TEST_FLAGS .
- name: Reporting
if: matrix.full-tests
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go install github.com/mattn/[email protected]
goveralls -coverprofile=coverage.out -service=github