-
Notifications
You must be signed in to change notification settings - Fork 5
61 lines (59 loc) · 1.28 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
name: CI
on:
pull_request:
permissions:
contents: read
pull-requests: write
security-events: write
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ^1.20
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Build
run: |
make build
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: ^1.20
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: --timeout 4m0s
vet:
name: Vet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Vet
run: go vet ./...
test:
name: Test
needs: [ build ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v3
with:
go-version: ^1.20
- name: Generated files
run: |
export PATH=$PATH:$(go env GOPATH)/bin
make generate fmt
git diff --exit-code --numstat
- name: Run tests
run: |
make test
env:
GOPATH: /home/runner/work/cli/go