-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): fail if there are changed files
- Loading branch information
1 parent
0ebce44
commit 163ba83
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Check generated files | ||
|
||
on: [push] | ||
|
||
jobs: | ||
gen: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
|
||
- name: Install tools | ||
run: make install | ||
|
||
- name: Generate code | ||
run: | | ||
# We need to start database so that sqlboiler can generate code | ||
docker compose up db migrate -d | ||
# Wait for migrations to pass | ||
docker wait go-presentation-generate-code-migrate-1 | ||
# Generate code | ||
make generate | ||
# Cleanup | ||
docker compose down | ||
- name: Fail if there are changed files | ||
run: | | ||
CHANGED_FILES=$(git diff --name-only) | ||
if [ -n "${CHANGED_FILES}" ]; then | ||
echo "Your generated files are off. Don't forget to run 'make generate'" | ||
echo "${CHANGED_FILES}" | ||
exit 1 | ||
fi |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters