Skip to content

Commit

Permalink
Add a CI job to ensure generated types are updated
Browse files Browse the repository at this point in the history
Ensure that type generation from `schema.json` is up-to-date.

* Check out the repo
* Run `make generate`
* Ensure that there is no diff
  • Loading branch information
andrew-farries committed Jan 10, 2024
1 parent f5e1f62 commit 51d041a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,21 @@ jobs:
fi
done
type-generation:
name: type generation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Ensure generated types are up-to-date
run: |
make generate > /dev/null 2>&1
if ! git diff --quiet; then
echo "generated types are out of date!"
echo "run `make generate` to regenerate type definitions from `schema.json`"
exit 1
fi
license-check:
name: License check
runs-on: ubuntu-latest
Expand Down Expand Up @@ -106,7 +121,7 @@ jobs:
release:
runs-on: ubuntu-latest
needs: [test, lint, examples, license-check]
needs: [test, lint, examples, license-check, type-generation]
if: startsWith(github.ref, 'refs/tags/')
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
Expand Down

0 comments on commit 51d041a

Please sign in to comment.