Skip to content

Commit 53543d6

Browse files
Add a CI step that checks whether the generated files are up-to-date.
1 parent 11f8f15 commit 53543d6

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,10 @@ jobs:
2525
- name: Install dependencies
2626
run: npm install
2727

28+
- name: Build and check generated files
29+
run: |
30+
npm run build
31+
script/check-generated-files
32+
2833
- name: Test corpus & parse examples
2934
run: npm test

script/check-generated-files

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
5+
if ! git diff-index --quiet HEAD -- {tsx,typescript}/src/; then
6+
cat 1>&2 <<EOF
7+
Generated files in the working tree are inconsistent with HEAD.
8+
Make sure to commit generated files in {tsx,typescript}/src/ when the grammar changes.
9+
EOF
10+
exit 1
11+
fi
12+
13+
exit 0

0 commit comments

Comments
 (0)