-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (47 loc) · 1.19 KB
/
build-go.yaml
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
name: build-go
on:
push:
branches:
- master
pull_request:
defaults:
run:
shell: bash
env:
GO111MODULE: on
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go:
- "1.17"
- "1.18"
- "1.19"
- "1.20"
- "1.21"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: setup
run: |
go version
go install github.com/securego/gosec/cmd/gosec@latest
go install github.com/axw/gocov/gocov@master
go install github.com/AlekSi/gocov-xml@latest
- name: setup-for-older-go
if: ${{ matrix.go <= 1.17 }}
run: |
# stay on an older version of golangci-lint which still builds against 1.17
# This is due to the introduction of generics.
go install github.com/golangci/golangci-lint/cmd/[email protected]
- name: setup-for-newer-go
if: ${{ matrix.go > 1.17 }}
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- name: build
run: |
make