-
Notifications
You must be signed in to change notification settings - Fork 53
76 lines (61 loc) · 1.81 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
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.x'
- name: Check out code
uses: actions/checkout@v4
- name: Cache go mod
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-
- name: golangci-lint
with: { version: latest }
uses: golangci/golangci-lint-action@v4
- name: dump dependencies (for nancy)
run: go list -json -m all > go.list
- name: Nancy (deps vulnerabilities)
uses: sonatype-nexus-community/nancy-github-action@main
build:
name: build
runs-on: ubuntu-latest
needs: lint
strategy: { matrix: { go: [ '1.21.x', '1.22.x'] } }
steps:
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Check out code
uses: actions/checkout@v4
with: { fetch-depth: 0 }
- name: Cache go mod
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-
- name: Test
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Build listen example
run: go build -v ./examples/listen/
- name: Build run example
run: go build -v ./examples/run/
- name: Build tab example
run: go build -v ./examples/tab/