Skip to content

Commit 278f841

Browse files
authored
only run codegen if go code/modules have changed (#7328)
1 parent 5fdb4e9 commit 278f841

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,26 +183,32 @@ jobs:
183183
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
184184
with:
185185
go-version-file: go.mod
186+
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
186187

187188
- name: Check if go.mod and go.sum are up to date
188189
run: go mod tidy && git diff --exit-code -- go.mod go.sum
190+
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
189191

190192
- name: Check if CRDs changed
191193
run: make update-crds && git diff --name-only --exit-code config/crd/bases
194+
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
192195

193196
- name: Check if Codegen changed
194197
run: |
195198
cd ../.. && mkdir -p github.com/nginx && mv kubernetes-ingress/kubernetes-ingress github.com/nginx/ && cd github.com/nginx/kubernetes-ingress
196199
make update-codegen && git diff --name-only --exit-code pkg/**
197200
cd ../../.. && mv github.com/nginx/kubernetes-ingress kubernetes-ingress/kubernetes-ingress
201+
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
198202

199203
- name: Install gofumpt
200204
run: go install mvdan.cc/gofumpt@latest
205+
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
201206

202207
- name: Check if telemetry schema changed
203208
run: |
204209
export PATH=$PATH:$(go env GOPATH)/bin
205210
make telemetry-schema && git diff --name-only --exit-code internal/telemetry
211+
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
206212

207213
- name: Check if make docs builds
208214
if: ${{ needs.checks.outputs.some_docs == 'true' }}

0 commit comments

Comments
 (0)