Skip to content

Commit

Permalink
Merge pull request #504 from jiridanek/jd_unittest_generate
Browse files Browse the repository at this point in the history
RHOAIENG-16751: chore(gha): add test for checking the values match between Version file and metadata yaml file
  • Loading branch information
openshift-merge-bot[bot] authored Jan 14, 2025
2 parents 330d816 + 40343bd commit 3fbc9c2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/code-quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,23 @@ jobs:
go mod tidy
$(go env GOPATH)/bin/govulncheck -show=verbose ./...
working-directory: ${{ matrix.component }}

check-generated-code:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Rerun all code generators we have
run: bash ci/generate_code.sh

- name: Check there aren't any modified files present
run: |
clean=$(git status --porcelain)
if [[ -z "$clean" ]]; then
echo "Empty git status --porcelain: $clean"
else
echo "::error::Please run 'bash ci/generate_code.sh' (the command from the previous step), commit the changed files locally, and push again."
echo "Uncommitted file changes detected: $clean"
git diff
exit 1
fi
12 changes: 12 additions & 0 deletions ci/generate_code.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -Eeuxo pipefail

# Run all code generators we use in this repository.
# It is used to check for mismatches in GitHub Actions workflow.

# go projects
(cd components/notebook-controller; make manifests generate fmt)
(cd components/odh-notebook-controller; make manifests generate fmt)

# component metadata yaml file
(cd components/notebook-controller; bash generate-metadata-yaml.sh -o config/component_metadata.yaml)

0 comments on commit 3fbc9c2

Please sign in to comment.