Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add verify generate and gomod #126

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,38 @@ jobs:
- name: Run make verify-imports
run: |
make verify-imports
verify-generate:
pehala marked this conversation as resolved.
Show resolved Hide resolved
name: Verify generate
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21.x
uses: actions/setup-go@v5
with:
go-version: 1.21.x
cache: false
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Verify generate command
run: |
make verify-generate

verify-go-mod:
name: Verify go.mod
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21.x
uses: actions/setup-go@v5
with:
go-version: 1.21.x
cache: false
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Verify generate command
run: |
make verify-go-mod

unit_test_suite:
name: Unit Test Suite
runs-on: ubuntu-latest
Expand Down
11 changes: 10 additions & 1 deletion make/verify.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Targets to verify actions that generate/modify code have been executed and output committed

.PHONY: verify-all
verify-all: verify-code verify-bundle verify-imports verify-manifests
verify-all: verify-code verify-bundle verify-imports verify-manifests verify-generate verify-go-mod

.PHONY: verify-code
verify-code: vet ## Verify code formatting
Expand All @@ -23,3 +23,12 @@ verify-bundle: bundle ## Verify bundle update.
.PHONY: verify-imports
verify-imports: ## Verify go imports are sorted and grouped correctly.
hack/verify-imports.sh

.PHONY: verify-generate
verify-generate: generate ## Verify generate update.
git diff --exit-code ./api ./internal/controller

.PHONY: verify-go-mod
verify-go-mod: ## Verify go.mod matches source code
go mod tidy
git diff --exit-code ./go.mod
Loading