Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check generated file as part of GitHub Workflow #200

Merged
merged 1 commit into from
Mar 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
go-version: [1.10]
steps:
- uses: actions/checkout@v1
- name: Kustomize and diff
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool. it seems this runs as part of this PR too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that was a successful execution.

run: DELTA_CHECK=true make kustomize
- name: Set up Go@${{ matrix.go-version }}
uses: actions/setup-go@v1
with:
Expand Down
16 changes: 16 additions & 0 deletions script/kustomize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,19 @@ for deployment in ${DEPLOYMENT}; do
"overlays/${deployment}/flyte" \
> "${DIR}/../deployment/${deployment}/flyte_generated.yaml"
done

# This section is used by GitHub workflow to ensure that the generation step was run
if [ -n "$DELTA_CHECK" ]; then
DIRTY=$(git status --porcelain)
if [ -n "$DIRTY" ]; then
echo "FAILED: kustomize code updated without commiting generated code."
echo "Ensure make kustomize has run and all changes are committed."
DIFF=$(git diff)
echo "diff detected: $DIFF"
DIFF=$(git diff --name-only)
echo "files different: $DIFF"
exit 1
else
echo "SUCCESS: Generated code is up to date."
fi
fi