Skip to content

Commit

Permalink
ci: update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ObserverOfTime committed Apr 1, 2024
1 parent f7dd766 commit 4a27fc5
Showing 1 changed file with 32 additions and 14 deletions.
46 changes: 32 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,47 @@ 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: Set up repository
uses: tree-sitter/[email protected]
- 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
uses: tj-actions/changed-files@v42
id: scanner-check
if: runner.os == 'Linux'
with:
files: src/scanner.c
- name: Fuzz scanner
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.any_changed == 'true'
if: steps.scanner-check.outputs.changed == 'true'
with:
corpus: examples
- name: Run tests
uses: tree-sitter/[email protected]
with:
test-library: ${{runner.os == 'Linux'}}
corpus-files: examples/*
invalid-files: examples/invalid.test

0 comments on commit 4a27fc5

Please sign in to comment.