Skip to content

ci: use upstream actions #12

ci: use upstream actions

ci: use upstream actions #12

Workflow file for this run

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: Set up the repo
uses: tree-sitter/[email protected]
with:
node-version: ${{vars.NODE_VERSION}}
- name: Clone Svelte repo
uses: actions/checkout@v4
with:
path: examples/svelte
repository: sveltejs/svelte
ref: a279e802d53cd84008a1016b88c2d3280d35aabf
sparse-checkout: |-
packages/svelte/tests/
documentation/examples/
sites/svelte.dev/src/
- name: Run tests
uses: tree-sitter/[email protected]
with:
lint: ${{runner.os == 'Linux'}}
test-library: ${{runner.os == 'Linux'}}
corpus-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/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/**/*.svelte
examples/svelte/packages/svelte/tests/validator/samples/attribute-expected-equals/input.svelte
examples/svelte/packages/svelte/tests/validator/samples/attribute-invalid-name/input.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'