Skip to content

ci: update workflow #27

ci: update workflow

ci: update workflow #27

Workflow file for this run

name: CI
on:
push:
branches:
- master
- main
paths:
- grammar.js
- src/**
- test/**
- bindings/**
- binding.gyp
pull_request:
paths:
- grammar.js
- src/**
- test/**
- bindings/**
- binding.gyp
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
jobs:
test:
name: Test parser
runs-on: ${{matrix.os}}
needs: [fuzz]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-14]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up tree-sitter
uses: tree-sitter/setup-action/cli@v1
- name: Run tests
uses: tree-sitter/parser-test-action@v2
with:
test-node: true
test-rust: ${{runner.os == 'Linux'}}
test-go: ${{runner.os == 'Windows'}}
test-swift: ${{runner.os == 'macOS'}}
node-version: ${{vars.NODE_VERSION}}
- name: Parse examples
uses: tree-sitter/parse-action@v4
with:
files: examples/*
invalid-files: examples/invalid.test
fuzz:
name: Fuzz scanner
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Check for scanner changes
id: scanner-check
run: |-
if git diff --quiet HEAD^ -- src/scanner.c; then
printf 'changed=false\n' >> "$GITHUB_OUTPUT"
else
printf 'changed=true\n' >> "$GITHUB_OUTPUT"
fi
- name: Run the fuzzer
uses: tree-sitter/fuzz-action@v4
if: steps.scanner-check.outputs.changed == 'true'
with:
corpus: examples