Skip to content

Commit 9c11389

Browse files
committed
ci: add generated file freshness check (fixes #50)
1 parent c070a55 commit 9c11389

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,35 @@ jobs:
7373
exit 1
7474
fi
7575
76+
verify-generated:
77+
runs-on: ubuntu-latest
78+
79+
steps:
80+
- name: Checkout
81+
uses: actions/checkout@v4
82+
83+
- name: Install Go
84+
uses: actions/setup-go@v5
85+
with:
86+
go-version: 1.24.x
87+
88+
- name: Install tools
89+
run: make tools
90+
91+
- name: Regenerate yacc parser
92+
run: |
93+
cd expressions
94+
goyacc expressions.y
95+
gofmt -w y.go
96+
97+
- name: Check for differences
98+
run: |
99+
if [ -n "$(git status --porcelain)" ]; then
100+
echo "Generated parser files are out of date. Please run 'go generate ./...' and commit the results."
101+
git diff
102+
exit 1
103+
fi
104+
76105
verify-mod:
77106
runs-on: ubuntu-latest
78107

0 commit comments

Comments
 (0)