-
Notifications
You must be signed in to change notification settings - Fork 140
90 lines (90 loc) · 2.29 KB
/
ci.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
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
---
name: ci
on:
push:
branches:
- "master"
- "release/v*"
paths-ignore:
- "**/*.png"
- "**/*.md"
pull_request:
branches:
- "master"
- "release/v*"
paths-ignore:
- "**/*.png"
- "**/*.md"
jobs:
yamllint:
name: yamllint
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: yaml-lint
uses: ibiqlik/action-yamllint@v1
with:
config_file: .ci/yamllint.yml
strict: true
build-and-test:
name: build-and-test
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: '1.20'
- name: Build
run: go build -race ./internal/...
- name: Test
run: go test -race `go list ./internal/... | grep -v e2e`
go-lint:
name: go-lint
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: golint
uses: Jerome1337/[email protected]
with:
golint-path: './internal/...'
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: '1.20'
- name: golangci-lint
uses: golangci/[email protected]
with:
args: --timeout=10m --tests="false"
style-check:
name: style-check
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.20'
- name: Install dependencies
run: |
go version
go install golang.org/x/tools/cmd/goimports@latest
- name: gofmt and goimports
run: make style-check
checkgomod:
name: go-mod-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: '1.20'
- run: go mod tidy
- name: Check for changes in go.mod or go.sum
run: |
git diff --name-only --exit-code go.mod || ( echo "Run go tidy" && false )
git diff --name-only --exit-code go.sum || ( echo "Run go tidy" && false )