Skip to content

Commit b29f1d2

Browse files
committed
feat: CICD check for generated code
Closes #120
1 parent 0167820 commit b29f1d2

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Code Generation Check
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
codegen-check:
11+
name: Verify Code Generation
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v5
16+
with:
17+
submodules: recursive
18+
19+
- name: Run code generation in devcontainer
20+
uses: devcontainers/[email protected]
21+
with:
22+
runCmd: |
23+
# Run all code generation steps
24+
make antlr
25+
./gen_proto.sh
26+
make codegen-extensions
27+
28+
- name: Check for uncommitted changes (ignoring timestamps)
29+
run: |
30+
# Check for diffs, ignoring timestamp lines
31+
if ! git diff -I '#.*timestamp:.*' --quiet --exit-code src/substrait/gen/; then
32+
echo "Code generation produced changes. Generated code is out of sync!"
33+
echo ""
34+
git diff -I '#.*timestamp:.*' src/substrait/gen/
35+
echo ""
36+
echo "To fix this, run:"
37+
echo " make antlr"
38+
echo " ./gen_proto.sh"
39+
echo " make codegen-extensions"
40+
echo "Then commit the changes."
41+
exit 1
42+
fi

0 commit comments

Comments
 (0)