-
Notifications
You must be signed in to change notification settings - Fork 13
119 lines (97 loc) · 2.8 KB
/
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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Go
on:
push:
branches:
- main
- autoupdate/strict
- 'release-[0-9]+.[0-9]+'
- 'release-[0-9]+.[0-9]+-strict'
pull_request:
jobs:
test:
name: Unit Tests & Code Quality
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: go mod download
working-directory: src/k8s
run: go mod download
- name: go fmt
working-directory: src/k8s
run: make go.fmt
- name: go doc
working-directory: src/k8s
run: make go.doc
- name: check diff
run: |
if ! [ -z "$(git diff)" ]; then
echo "Detected changes that have not been committed to the repository"
echo "Please run 'cd src/k8s && make go.fmt go.doc'"
echo "git diff:"
git diff
exit 1
fi
- name: go vet
working-directory: src/k8s
run: make go.vet
- name: go deadcode
working-directory: src/k8s
run: make go.deadcode
- name: go test
working-directory: src/k8s
run: |
make go.unit
go install github.com/boumenot/gocover-cobertura@latest
gocover-cobertura < coverage.txt > coverage.xml
- name: Generate code coverage report
uses: irongut/[email protected]
with:
filename: src/k8s/coverage.xml
badge: false
fail_below_min: false
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: false
output: both
thresholds: '60 80'
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
continue-on-error: true
test-binary:
name: Binaries
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: go mod download
working-directory: src/k8s
run: go mod download
- name: Build static binaries
working-directory: src/k8s
run: |
make -j static
./bin/static/k8s --help
./bin/static/k8sd --help
./bin/static/k8s-apiserver-proxy --help
- name: Build shared binaries
working-directory: src/k8s
run: |
make -j dynamic
export LD_LIBRARY_PATH=bin/dynamic/lib
./bin/dynamic/k8s --help
./bin/dynamic/k8sd --help
./bin/dynamic/k8s-apiserver-proxy --help