Merge commit '3ae76c1467d047743c3e2d7a418a8cbc905a6938' #400
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and tests | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
tags: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
tests: | |
name: "Build and run parser tests" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
fail-fast: false | |
steps: | |
- name: Checkout parser sources | |
uses: actions/checkout@v3 | |
- name: Checkout Zeek sources | |
uses: actions/checkout@v3 | |
with: | |
repository: zeek/zeek | |
path: test/zeek-src | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "20" | |
- run: npm install | |
- name: Add Node.js to PATH | |
run: echo "$PWD/node_modules/.bin" >> $GITHUB_PATH | |
- name: Setup tree-sitter | |
# "tree-sitter init-config" adds $HOME/github as a default | |
# directory to look for languages in, so we create a symlink | |
# that directs it to our local clone. | |
run: | | |
ln -s $(cd .. && pwd) $HOME/github | |
tree-sitter init-config | |
- name: Generate parser | |
run: tree-sitter generate | |
- name: Test Zeek grammar | |
run: cd test && ./parse-zeek-tree.sh ./zeek-src/scripts | |
- name: Upload test artifacts | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: parser-errors | |
path: | | |
test/*.zeek | |
test/*.err |