@@ -16,39 +16,80 @@ concurrency:
16
16
cancel-in-progress : true
17
17
18
18
jobs :
19
- build-api-docs :
19
+ code-check :
20
20
runs-on : ubuntu-latest
21
21
steps :
22
22
- name : Checkout source code
23
23
uses : actions/checkout@v4
24
+ with :
25
+ fetch-depth : 0
24
26
25
27
- name : Set up Go
26
28
uses : actions/setup-go@v5
27
29
with :
28
30
go-version-file : go.mod
29
31
30
- - name : The API documentation hasn't changed
32
+ - name : Run go mod tidy
31
33
run : |
32
- make build-api-docs
33
- if ! git diff --quiet -- docs/api-docs.md ; then
34
- echo "Need to re- run 'make build-api-docs ' and commit the changes"
35
- git diff -- docs/api-docs.md;
34
+ go mod tidy
35
+ if ! git diff --quiet; then
36
+ echo "Please run 'go mod tidy ' and commit the changes. "
37
+ git diff
36
38
false
37
39
fi
38
40
39
- build-sparkctl :
41
+ - name : Generate code
42
+ run : |
43
+ make generate
44
+ if ! git diff --quiet; then
45
+ echo "Need to re-run 'make generate' and commit the changes."
46
+ git diff
47
+ false
48
+ fi
49
+
50
+ - name : Run go fmt check
51
+ run : |
52
+ make go-fmt
53
+ if ! git diff --quiet; then
54
+ echo "Need to re-run 'make go-fmt' and commit the changes."
55
+ git diff
56
+ false
57
+ fi
58
+
59
+ - name : Run go vet check
60
+ run : |
61
+ make go-vet
62
+ if ! git diff --quiet; then
63
+ echo "Need to re-run 'make go-vet' and commit the changes."
64
+ git diff
65
+ false
66
+ fi
67
+
68
+ - name : Run golangci-lint
69
+ run : |
70
+ make go-lint
71
+
72
+ build-api-docs :
40
73
runs-on : ubuntu-latest
41
74
steps :
42
75
- name : Checkout source code
43
76
uses : actions/checkout@v4
77
+ with :
78
+ fetch-depth : 0
44
79
45
80
- name : Set up Go
46
81
uses : actions/setup-go@v5
47
82
with :
48
83
go-version-file : go.mod
49
84
50
- - name : build sparkctl
51
- run : make build-sparkctl
85
+ - name : Build API docs
86
+ run : |
87
+ make build-api-docs
88
+ if ! git diff --quiet; then
89
+ echo "Need to re-run 'make build-api-docs' and commit the changes."
90
+ git diff
91
+ false
92
+ fi
52
93
53
94
build-spark-operator :
54
95
runs-on : ubuntu-latest
@@ -63,18 +104,28 @@ jobs:
63
104
with :
64
105
go-version-file : go.mod
65
106
66
- - name : Run go fmt check
67
- run : make go-fmt
68
-
69
- - name : Run go vet check
70
- run : make go-vet
71
-
72
- - name : Run unit tests
107
+ - name : Run go unit tests
73
108
run : make unit-test
74
109
75
110
- name : Build Spark operator
76
111
run : make build-operator
77
112
113
+ build-sparkctl :
114
+ runs-on : ubuntu-latest
115
+ steps :
116
+ - name : Checkout source code
117
+ uses : actions/checkout@v4
118
+ with :
119
+ fetch-depth : 0
120
+
121
+ - name : Set up Go
122
+ uses : actions/setup-go@v5
123
+ with :
124
+ go-version-file : go.mod
125
+
126
+ - name : Build sparkctl
127
+ run : make build-sparkctl
128
+
78
129
build-helm-chart :
79
130
runs-on : ubuntu-latest
80
131
steps :
@@ -103,6 +154,18 @@ jobs:
103
154
- name : Set up chart-testing
104
155
105
156
157
+ - name : Generate manifests
158
+ run : |
159
+ make manifests
160
+ if ! git diff --quiet; then
161
+ echo "Need to re-run 'make manifests' and commit the changes."
162
+ git diff
163
+ false
164
+ fi
165
+
166
+ - name : Detect CRDs drift between chart and manifest
167
+ run : make detect-crds-drift
168
+
106
169
- name : Run chart-testing (list-changed)
107
170
id : list-changed
108
171
env :
@@ -119,22 +182,18 @@ jobs:
119
182
BRANCH : ${{ steps.get_branch.outputs.BRANCH }}
120
183
run : ct lint --check-version-increment=false --target-branch $BRANCH
121
184
122
- - name : Detect CRDs drift between chart and manifest
123
- if : steps.list-changed.outputs.changed == 'true'
124
- run : make detect-crds-drift
125
-
126
185
- name : Produce the helm documentation
127
186
if : steps.list-changed.outputs.changed == 'true'
128
187
run : |
129
188
make helm-docs
130
189
if ! git diff --quiet -- charts/spark-operator-chart/README.md; then
131
- echo "Need to re-run 'make helm-docs' and commit the changes"
190
+ echo "Need to re-run 'make helm-docs' and commit the changes. "
132
191
false
133
192
fi
134
193
135
194
- name : setup minikube
136
195
if : steps.list-changed.outputs.changed == 'true'
137
- uses : manusa/actions-setup-minikube@v2.11 .0
196
+ uses : manusa/actions-setup-minikube@v2.12 .0
138
197
with :
139
198
minikube version : v1.33.0
140
199
kubernetes version : v1.30.0
0 commit comments