2022-10-25 16:06:21 +02:00
|
|
|
# This workflow check
|
|
|
|
name: Operator code generation check
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- "release/**"
|
|
|
|
paths:
|
|
|
|
- "operators/**"
|
2023-01-19 10:35:48 +01:00
|
|
|
- "./.github/workflows/test-operator-codegen.yml"
|
2022-10-25 16:06:21 +02:00
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- "operators/**"
|
2023-01-19 10:35:48 +01:00
|
|
|
- "./.github/workflows/test-operator-codegen.yml"
|
2022-10-25 16:06:21 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
govulncheck:
|
|
|
|
name: check-codegen
|
2024-10-09 12:16:10 +02:00
|
|
|
runs-on: ubuntu-24.04
|
2022-10-25 16:06:21 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-11-28 16:15:26 +01:00
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2022-10-25 16:06:21 +02:00
|
|
|
with:
|
2022-12-19 15:21:28 +01:00
|
|
|
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
2022-10-25 16:06:21 +02:00
|
|
|
|
|
|
|
- name: Setup Go environment
|
2024-11-28 16:15:26 +01:00
|
|
|
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
|
2022-10-25 16:06:21 +02:00
|
|
|
with:
|
2024-10-15 13:52:45 +02:00
|
|
|
go-version: "1.23.2"
|
2022-10-25 16:06:21 +02:00
|
|
|
cache: true
|
|
|
|
|
|
|
|
- name: Run code generation
|
|
|
|
shell: bash
|
|
|
|
working-directory: "operators/"
|
|
|
|
run: |
|
|
|
|
dirs=$(find . \! -name . -prune -type d)
|
|
|
|
for dir in $dirs; do
|
2022-11-11 14:49:16 +01:00
|
|
|
(cd "$dir"; make manifests generate)
|
2022-10-25 16:06:21 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
- name: Check diff and fail on changes
|
|
|
|
shell: bash
|
|
|
|
run: git diff --exit-code
|