-
-
Notifications
You must be signed in to change notification settings - Fork 9
88 lines (86 loc) · 2.88 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Test grammar
on:
push:
branches: [master]
paths:
- "scripts.js"
- "common/*"
- "*/grammar.js"
- "*/src/**"
- "bindings/**"
- "binding.gyp"
pull_request:
paths:
- "scripts.js"
- "common/*"
- "*/grammar.js"
- "*/src/**"
- "bindings/**"
- "binding.gyp"
jobs:
test:
name: Test parsers
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 NodeJS
uses: actions/setup-node@v4
with:
cache: npm
node-version: ${{vars.NODE_VERSION}}
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.8
if: runner.os == 'macOS'
- name: Install dependencies
shell: sh
run: npm ci
- name: Clone examples
uses: actions/checkout@v4
with:
path: examples/lemminx
repository: eclipse/lemminx
sparse-checkout: org.eclipse.lemminx/src/test/resources
ref: 6b12cd0a89205c2791ef1240e0d8401103f8c9a9
- name: Run tests
uses: tree-sitter-grammars/actions/test@main
with:
test-library: ${{runner.os == 'Linux'}}
examples: |-
examples/lemminx/org.eclipse.lemminx/src/test/resources/catalogs/
examples/lemminx/org.eclipse.lemminx/src/test/resources/xml-model/
examples/lemminx/org.eclipse.lemminx/src/test/resources/xml/
examples/lemminx/org.eclipse.lemminx/src/test/resources/xsd/
examples/lemminx/org.eclipse.lemminx/src/test/resources/dtd/
!examples/lemminx/org.eclipse.lemminx/src/test/resources/xsd/empty.xsd
!examples/lemminx/org.eclipse.lemminx/src/test/resources/xsd/foo-invalid-syntax.xsd
!examples/lemminx/org.eclipse.lemminx/src/test/resources/xsd/foo-ns-invalid-syntax.xsd
!examples/lemminx/org.eclipse.lemminx/src/test/resources/dtd/foo-invalid.dtd
!examples/lemminx/org.eclipse.lemminx/src/test/resources/xml/largeFile.xml
!examples/lemminx/org.eclipse.lemminx/src/test/resources/xml/content.xml
fuzz:
name: Fuzz parsers
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [xml, dtd]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check for scanner changes
id: scanner-changes
uses: tj-actions/changed-files@v42
with:
files: |-
common/scanner.h
${{matrix.language}}/src/scanner.c
- name: Fuzz ${{matrix.language}} parser
uses: tree-sitter-grammars/tree-sitter-fuzz-action@v3
if: steps.scanner.changes.outputs.any_changed == 'true'
with:
directory: ${{matrix.language}}