generated from tree-sitter-grammars/template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f7dd766
commit 4a27fc5
Showing
1 changed file
with
32 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |