Generate and check parser code on CI
On Linux, we re-generate the parser code and make sure
it matches up with what's committed
On other platforms, we only run tests, because generation
takes a very long time, and OOMs on Windows
@@ -10,15 +10,22 @@ jobs:
strategy:
fail-fast: true
matrix:
- os: [macos-latest, ubuntu-latest, windows-2019]
+ os: [macos-latest, ubuntu-20.04, windows-2019]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- - shell: bash
+
+ - name: Test C stack code
+ run: gcc test/test-stack.c -o a.out && ./a.out
+
+ - name: Generate and check parser
+ if: matrix.os == 'ubuntu-20.04'
run: |
- gcc test/test-stack.c -o a.out
- ./a.out
- npm install
- npm test
+ npm install && npm run build
+ git diff --quiet || (echo "::error file=grammar.js::Generated parser differs from the checked in version" && exit 1)
+
+ - name: Parser tests
+ shell: bash
+ run: npm install && npm run test
