-
-
Notifications
You must be signed in to change notification settings - Fork 9
90 lines (87 loc) · 2.87 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
89
90
name: CI
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"
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
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 tree-sitter
uses: tree-sitter/setup-action/cli@v1
- 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/parser-test-action@v2
with:
test-rust: ${{runner.os == 'Linux'}}
- name: Parse examples
uses: tree-sitter/parse-action@v4
continue-on-error: ${{runner.os == 'Windows'}}
with:
files: |-
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/xml/largeFile.xml
!examples/lemminx/org.eclipse.lemminx/src/test/resources/xml/content.xml
invalid-files: |-
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
fuzz:
name: Fuzz parsers
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [xml, dtd]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- 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/fuzz-action@v4
if: steps.scanner-changes.outputs.any_changed == 'true'
with:
directory: ${{matrix.language}}