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 12, 2022
1 parent e18eff0 commit fb979c3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/check-codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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: Check if there are changes
id: changes
uses: UnicornGlobal/has-changes-action@v1.0.11
- name: Process changes
if: steps.changes.outputs.changed == 1
run: echo "Please run 'make generate' and commit the generated code."
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 fb979c3

Please sign in to comment.