Skip to content

Commit

Permalink
only run codegen if go code/modules have changed (#7328)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdabelf5 authored Feb 7, 2025
1 parent 5fdb4e9 commit 278f841
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,26 +183,32 @@ jobs:
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: go.mod
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' }}

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

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

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

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

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

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

0 comments on commit 278f841

Please sign in to comment.