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

test: add basic CI testing against PRs via new Github Action #88

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
37 changes: 37 additions & 0 deletions .github/workflows/validation-gen-ci-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: validation-gen CI Tests

on:
pull_request:
branches:
- "validation-gen"

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4

- name: Run go mod tidy and check for diffs
run: |
go mod tidy
git diff --exit-code

- name: Run code generation and check for diffs
run: |
hack/update-codegen.sh validation
git diff --exit-code

- name: Run validation-gen go tests and also check for diffs with generated test fixture code
env:
UPDATE_VALIDATION_GEN_FIXTURE_DATA: "true"
run: |
go test ./staging/src/k8s.io/code-generator/cmd/validation-gen/...
go test ./stagings/src/k8s.io/apimachinery/pkg/api/...
go test ./stagings/src/k8s.io/apimachinery/pkg/util/...
git diff --exit-code

Loading