-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (72 loc) · 2.35 KB
/
Copy pathci.yml
File metadata and controls
81 lines (72 loc) · 2.35 KB
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
name: CI
on:
push:
branches: [main]
paths:
- .github/workflows/**
- grammar.js
- src/**
- bindings/**
- binding.gyp
pull_request:
paths:
- grammar.js
- src/**
- 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-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up tree-sitter
uses: tree-sitter/setup-action/cli@v2
- uses: actions/checkout@v4
- uses: tree-sitter/parser-test-action@v3
with:
generate: true
test-rust: ${{runner.os == 'Linux'}}
test-node: true
node-version: 20
test-python: true
python-version: "3.10"
fuzz:
name: Fuzz scanner
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Check for scanner changes
id: scanner-check
shell: sh
run: |-
{
test -f src/scanner.c && ! git diff --quiet HEAD^ -- "$_" &&
printf 'changed=true\n' || printf 'changed=false\n'
} >> "$GITHUB_OUTPUT"
- name: Run fuzzer
uses: tree-sitter/fuzz-action@v4
if: steps.scanner-check.outputs.changed == 'true'
query:
name: Validate queries
runs-on: ubuntu-latest
steps:
- name: Set up repository
uses: actions/checkout@v6
- name: Set up tree-sitter
uses: tree-sitter/setup-action/cli@v2
- name: Build parser
run: tree-sitter build
- name: Set up ts_query_ls
run: curl -fL https://github.com/ribru17/ts_query_ls/releases/latest/download/ts_query_ls-x86_64-unknown-linux-gnu.tar.gz | tar -xz
- name: Check queries
run: ./ts_query_ls check -f queries/