-
Notifications
You must be signed in to change notification settings - Fork 12
92 lines (88 loc) · 2.18 KB
/
test_and_build.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
on:
push:
branches:
- master
pull_request:
branches:
- master
name: test and build
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.2
- name: Run linters
run: |
export PATH=$PATH:$(go env GOPATH)/bin
./pre-commit
test:
runs-on: ubuntu-latest
strategy:
matrix:
goversion: ["1.15", "1.16", "1.17", "1.18", "1.19", "1.20", "1.21"]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.goversion }}
- name: Run tests
run: |
go version
make test
inttest:
runs-on: ubuntu-latest
strategy:
matrix:
buildversion: ["1.15", "1.16", "1.17", "1.18", "1.19", "1.20", "1.21"]
testversion: ["1.15", "1.16", "1.17", "1.18", "1.19", "1.20", "1.21"]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go to build artifact
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.buildversion }}
- name: Build artifact for inttest
run: |
go version
GO111MODULE=on make build-linux
- name: Install Go for inttest
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.testversion }}
- name: Integration test
run: |
go version
make inttest
build:
runs-on: ubuntu-latest
needs: [lint, test, inttest]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: build
run: |
go version
make build-linux
make build-windows
make build-darwin
- name: upload artifacts
uses: actions/upload-artifact@master
with:
name: bin
path: bin/