Merge pull request #194 from hendrikvanantwerpen/check-generated-files-in-ci

Add a CI step that checks whether the generated files are up-to-date
a_star_module
Martin Jambon 2021-10-29 14:55:07 +07:00 committed by GitHub
commit cc745b774e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

@ -25,5 +25,10 @@ jobs:
- name: Install dependencies
run: npm install
- name: Build and check generated files
run: |
npm run build
script/check-generated-files
- name: Test corpus & parse examples
run: npm test

@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -eu
if ! git diff-index --quiet HEAD -- {tsx,typescript}/src/; then
cat 1>&2 <<EOF
Generated files in the working tree are inconsistent with HEAD.
Make sure to commit generated files in {tsx,typescript}/src/ when the grammar changes.
EOF
exit 1
fi
exit 0