Skip to content

Commit

Permalink
Add codegen check workflow
Browse files Browse the repository at this point in the history
Make sure that the generated clients are up to date.
  • Loading branch information
afritzler committed Apr 13, 2022
1 parent e18eff0 commit 73a6729
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/check-codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Check Codegen

on:
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'

jobs:
check-codegen:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- uses: actions/setup-go@v2
with:
go-version: '1.17'
- name: Run make generate
run: make generate
- name: Compare the expected and actual generated/* directories
run: |
if [ "$(git diff --ignore-space-at-eol generated/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. Consider running 'make generate'."
echo "See status below:"
git diff
exit 1
fi
2 changes: 2 additions & 0 deletions apis/compute/machine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import (

// MachineSpec defines the desired state of Machine
type MachineSpec struct {
// Foo
Foo string
// MachineClassRef is a reference to the machine class/flavor of the machine.
MachineClassRef corev1.LocalObjectReference
// MachinePoolSelector selects a suitable MachinePoolRef by the given labels.
Expand Down
2 changes: 2 additions & 0 deletions apis/compute/v1alpha1/machine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import (

// MachineSpec defines the desired state of Machine
type MachineSpec struct {
// Foo
Foo string `json:"foo,omitempty"`
// MachineClassRef is a reference to the machine class/flavor of the machine.
MachineClassRef corev1.LocalObjectReference `json:"machineClassRef"`
// MachinePoolSelector selects a suitable MachinePoolRef by the given labels.
Expand Down

0 comments on commit 73a6729

Please sign in to comment.