-
Notifications
You must be signed in to change notification settings - Fork 16
70 lines (57 loc) · 1.45 KB
/
tree_sitter_v.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
name: Tree-sitter CI
on:
push:
paths:
- 'tree_sitter_v/**'
- '**/test_tree_sitter_v.yml'
pull_request:
paths:
- 'tree_sitter_v/**'
- '**/test_tree_sitter_v.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
test-grammar:
runs-on: ubuntu-latest
defaults:
run:
working-directory: tree_sitter_v
steps:
- name: Checkout v-analyzer
uses: actions/checkout@v4
- name: Install dependencies
run: npm update
- name: Run tests
run: npm run test
- name: Lint
run: npm run lint
- name: Verify formatting
run: npm run format:check
test-bindings:
runs-on: ubuntu-latest
steps:
- name: Install V
id: install-v
uses: vlang/setup-v@v1.4
with:
check-latest: true
- name: Checkout v-analyzer
uses: actions/checkout@v4
with:
submodules: true
- name: Run tests
run: v test tree_sitter_v/bindings
- name: Run examples
run: |
cd tree_sitter_v
exit_code=0
for example in $(find -wholename '*/examples/*.v'); do
v run $example
if [ $? -ne 0 ]; then
exit_code=1
echo $exit_code
echo "Failed to run example \`$example\`"
fi
done
exit $exit_code