Skip to content

Commit

Permalink
Update-codegen needs a specific path
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome committed Dec 14, 2021
1 parent 9197648 commit 2fdb997
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
path: github.com/nginxinc/
- name: Cache Go controller tools
uses: actions/cache@v2
with:
Expand All @@ -70,12 +72,20 @@ jobs:
- name: Determine GOPATH
id: go
run: echo "::set-output name=go_path::$(go env GOPATH)"
- run: |
pwd && ls -lrt
mv github.com ../../
pwd && ls -lrt
- name: Check if CRDs changed
run: |
pwd && ls -lrt
make update-crds && git diff --name-only --exit-code deployments/common/crds* deployments/helm-chart/crds*
working-directory: /home/runner/work/github.com/nginxinc/kubernetes-ingress
- name: Check if Codegen changed
run: |
# cd .. && mkdir -p github.com/nginxinc && mv kubernetes-ingress github.com/nginxinc/ && mv github.com .. && cd ../github.com/nginxinc/kubernetes-ingress
make update-codegen && git diff --name-only --exit-code pkg/**/zz_generated.deepcopy.go
working-directory: /home/runner/work/github.com/nginxinc/kubernetes-ingress

binary:
name: Build binary
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ update-codegen: ## Generate code
.PHONY: update-crds
update-crds: ## Update CRDs
go run sigs.k8s.io/controller-tools/cmd/controller-gen crd:crdVersions=v1 schemapatch:manifests=./deployments/common/crds/ paths=./pkg/apis/configuration/... output:dir=./deployments/common/crds
@cp -Rp deployments/common/crds/ deployments/helm-chart/crds
@cp -Rp deployments/common/crds/* deployments/helm-chart/crds/

.PHONY: certificate-and-key
certificate-and-key: ## Create default cert and key
Expand Down
2 changes: 1 addition & 1 deletion hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set -o pipefail

SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
CODEGEN_VERSION=$(grep 'k8s.io/code-generator' go.sum | awk '{print $2}' | sed 's/\/go.mod//g' | tail -1)
CODEGEN_PKG=$(echo `go env GOPATH`"/pkg/mod/k8s.io/code-generator@${CODEGEN_VERSION}")
CODEGEN_PKG=$(echo $(go env GOPATH)"/pkg/mod/k8s.io/code-generator@${CODEGEN_VERSION}")

if [[ ! -d ${CODEGEN_PKG} ]]; then
echo "${CODEGEN_PKG} is missing. Running 'go mod download'."
Expand Down

0 comments on commit 2fdb997

Please sign in to comment.