From 3000ac096812506848fb2df8c968351e04a2f720 Mon Sep 17 00:00:00 2001 From: Jonathan West Date: Thu, 20 Jun 2024 18:28:45 -0400 Subject: [PATCH] Add a check for consistency of generated manifests Signed-off-by: Jonathan West --- .github/workflows/codegen.yaml | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/codegen.yaml diff --git a/.github/workflows/codegen.yaml b/.github/workflows/codegen.yaml new file mode 100644 index 000000000..d811f5cae --- /dev/null +++ b/.github/workflows/codegen.yaml @@ -0,0 +1,56 @@ +name: Verify generated code is up to date +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + +jobs: + check-go-modules: + name: "Check for go.mod/go.sum synchronicity" + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup Golang + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - name: Download all Go modules + run: | + go mod download + - name: Check for tidyness of go.mod and go.sum + run: | + go mod tidy + git diff --exit-code -- . + + check-sdk-codegen: + name: "Check for changes from make bundle" + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup Golang + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - name: Run make bundle + run: | + make bundle + - name: Ensure there is no diff in bundle + run: | + git diff --exit-code -- . + - name: Run make generate + run: | + make generate + - name: Ensure there is no diff in generated assets + run: | + git diff --exit-code -- . + - name: Run make manifests + run: | + make manifests + - name: Ensure there is no diff in manifests + run: | + git diff --exit-code -- .