Skip to content

Commit

Permalink
CI: report error if the generated code has been modified, not generat…
Browse files Browse the repository at this point in the history
…ed or uncommitted
  • Loading branch information
mmetc committed Sep 24, 2024
1 parent 3945a99 commit b1bab3e
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 57 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,18 @@ jobs:
with:
go-version: "1.22"

- name: Run "make generate" and check for changes
run: |
set -e
make generate 2>/dev/null
if [[ $(git status --porcelain) ]]; then
echo "Error: Uncommitted changes found after running 'make generate'. Please commit all generated code."
git diff
exit 1
else
echo "No changes detected after running 'make generate'."
fi
- name: Create localstack streams
run: |
aws --endpoint-url=http://127.0.0.1:4566 --region us-east-1 kinesis create-stream --stream-name stream-1-shard --shard-count 1
Expand Down
10 changes: 0 additions & 10 deletions pkg/database/ent/bouncer/where.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 3 additions & 8 deletions pkg/database/ent/bouncer_create.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions pkg/database/ent/bouncer_update.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/database/ent/migrate/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 0 additions & 19 deletions pkg/database/ent/mutation.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/database/ent/schema/bouncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (Bouncer) Fields() []ent.Field {
field.String("version").Optional().StructTag(`json:"version"`),
field.Time("last_pull").Nillable().Optional().StructTag(`json:"last_pull"`),
field.String("auth_type").StructTag(`json:"auth_type"`).Default(types.ApiKeyAuthType),
field.String("osname").Optional(),
field.String("osname"),
field.String("osversion").Optional(),
field.String("featureflags").Optional(),
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/modelscapi/success_response.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b1bab3e

Please sign in to comment.