Add a corpus, fix a bunch of issues #38
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: |- | ||
<<<<<<< HEAD | ||
examples/svelte/packages/svelte/tests/compiler-errors/**/* | ||
======= | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/attribute-empty/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/catch-before-closing/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/catch-without-await/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/comment-unclosed/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/const-tag-whitespace/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/else-before-closing/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/else-before-closing-2/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/else-before-closing-3/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/else-if-before-closing/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/else-if-before-closing-2/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/else-if-without-if/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/empty-attribute-shorthand/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/empty-classname-binding/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/empty-directive-name/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/illegal-expression/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/invalid-snippet-binding/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/malformed-snippet/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/malformed-snippet-2/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/raw-mustaches-whitespace/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/script-unclosed/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/script-unclosed-eof/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/style-unclosed/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/style-unclosed-eof/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/svelte-selfdestructive/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/then-before-closing/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/then-without-await/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/unbalanced-curly-component/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/unbalanced-curly-element/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/unclosed-attribute-self-close-tag/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/unexpected-end-of-input/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/unexpected-end-of-input-b/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/unexpected-end-of-input-c/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/unexpected-end-of-input-d/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/unmatched-closing-tag/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/unmatched-closing-tag-autoclose/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/unmatched-closing-tag-autoclose-2/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/void-closing/main.svelte | ||
examples/svelte/packages/svelte/tests/compiler-errors/samples/window-children/main.svelte | ||
>>>>>>> 8789125 (Add two more samples to `invalid-files`) | ||
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 |