Add a corpus, fix a bunch of issues #42
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: [master] | |
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}} | |
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: Clone Svelte repo | |
uses: actions/checkout@v4 | |
with: | |
path: examples/svelte | |
repository: sveltejs/svelte | |
sparse-checkout: |- | |
packages/svelte/tests/ | |
documentation/examples/ | |
sites/svelte.dev/src/ | |
- name: Run tests | |
uses: tree-sitter/parser-test-action@v2 | |
with: | |
test-rust: ${{runner.os == 'Linux'}} | |
- name: Parse examples | |
uses: tree-sitter/parse-action@v4 | |
with: | |
files: |- | |
examples/svelte/**/*.svelte | |
!examples/svelte/packages/svelte/tests/parser-legacy/samples/implicitly-closed-li-block/input.svelte | |
!examples/svelte/packages/svelte/tests/parser-legacy/samples/no-error-if-before-closing/input.svelte | |
!examples/svelte/packages/svelte/tests/parser-legacy/samples/textarea-end-tag/input.svelte | |
!examples/svelte/packages/svelte/tests/preprocess/samples/script-self-closing/input.svelte | |
!examples/svelte/packages/svelte/tests/preprocess/samples/style-self-closing/input.svelte | |
!examples/svelte/packages/svelte/tests/compiler-errors/samples/runes-invalid-each-binding/main.svelte | |
!examples/svelte/packages/svelte/tests/runtime-legacy/samples/await-catch-no-expression/main.svelte | |
!examples/svelte/packages/svelte/tests/runtime-legacy/samples/binding-input-checkbox-with-event-in-each/main.svelte | |
!examples/svelte/packages/svelte/tests/runtime-legacy/samples/each-block-deconflict-name-context/main.svelte | |
!examples/svelte/packages/svelte/tests/runtime-legacy/samples/each-block-scope-shadow-self/main.svelte | |
!examples/svelte/packages/svelte/tests/runtime-legacy/samples/escape-template-literals/main.svelte | |
!examples/svelte/packages/svelte/tests/runtime-legacy/samples/event-handler-removal/main.svelte | |
!examples/svelte/packages/svelte/tests/runtime-legacy/samples/store-each-binding/main.svelte | |
!examples/svelte/packages/svelte/tests/runtime-legacy/samples/store-each-binding-deep/main.svelte | |
!examples/svelte/packages/svelte/tests/runtime-legacy/samples/store-each-binding-destructuring/main.svelte | |
!examples/svelte/packages/svelte/tests/runtime-legacy/samples/unchanged-expression-escape/main.svelte | |
invalid-files: |- | |
examples/svelte/packages/svelte/tests/compiler-errors/**/* | |
examples/svelte/packages/svelte/tests/validator/samples/attribute-expected-equals/input.svelte | |
examples/svelte/packages/svelte/tests/validator/samples/attribute-invalid-name/input.svelte | |
examples/svelte/packages/svelte/tests/validator/samples/html-block-in-attribute/input.svelte | |
examples/svelte/packages/svelte/tests/validator/samples/logic-block-in-attribute/input.svelte | |
examples/svelte/packages/svelte/tests/runtime-runes/samples/each-updates-6/main.svelte | |
examples/svelte/packages/svelte/tests/runtime-runes/samples/each-updates-7/main.svelte | |
fuzz: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Check for scanner changes | |
id: scanner-changes | |
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: Fuzz parser | |
uses: tree-sitter/fuzz-action@v4 | |
if: steps.scanner-changes.outputs.changed == 'true' | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: npm | |
node-version: ${{vars.NODE_VERSION}} | |
- name: Install dependencies | |
run: npm ci --ignore-scripts | |
- name: Run ESLint | |
run: npm run lint |