Skip to content

Commit b845841

Browse files
authored
Merge pull request #425 from eed3si9n/wip/fix-build-2
Fix build, take 2
2 parents b02af60 + fa2c5bd commit b845841

File tree

4 files changed

+43
-22
lines changed

4 files changed

+43
-22
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,25 @@ jobs:
7272
with:
7373
node-version: 20
7474

75+
- name: Set up tree-sitter
76+
uses: tree-sitter/setup-action/cli@v1
77+
7578
- name: Generate parser from scratch and test it
7679
if: ${{ runner.os == 'Linux' || needs.changedfiles.outputs.c }}
7780
shell: bash
78-
run: |
79-
npm install
80-
npm test
81+
run: tree-sitter generate
82+
83+
- name: Run parser and binding tests
84+
uses: tree-sitter/parser-test-action@v2
85+
with:
86+
test-rust: ${{runner.os == 'Linux'}}
87+
test-swift: ${{runner.os == 'macOS'}}
88+
89+
- name: Parse sample files
90+
uses: tree-sitter/parse-action@v4
91+
id: parse-files
92+
with:
93+
files: examples/**
8194

8295
- name: Check fidelity of checked-in C code
8396
if: ${{ runner.os == 'Linux' && needs.changedfiles.outputs.gen }}
@@ -113,9 +126,10 @@ jobs:
113126
files: |
114127
queries/*.scm
115128
116-
- name: Test quries if out of sync with nvim-treesitter
117-
if: steps.verify-changed-files.outputs.files_changed == 'true'
118-
run: |
119-
echo "::warning Queries in ${{ steps.verify-changed-files.outputs.changed_files }} in this repo are out of sync with nvim-treesitter"
120-
git diff queries/
121-
npm run test
129+
# TODO: uncomment when this works
130+
# - name: Test quries if out of sync with nvim-treesitter
131+
# if: steps.verify-changed-files.outputs.files_changed == 'true'
132+
# run: |
133+
# echo "::warning Queries in ${{ steps.verify-changed-files.outputs.changed_files }} in this repo are out of sync with nvim-treesitter"
134+
# git diff queries/
135+
# npm run test

.github/workflows/sync.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,18 @@ jobs:
1717
with:
1818
fetch-depth: 10
1919

20+
- name: Set up tree-sitter
21+
uses: tree-sitter/setup-action/cli@v1
22+
2023
- name: Generate parser from scratch
21-
run: |
22-
npm install
23-
npm run build
24+
shell: bash
25+
run: tree-sitter generate
2426

2527
- name: Format Javascipt
2628
run: |
2729
npm install
28-
npm run format
30+
export PATH=./node_modules/.bin:$PATH
31+
prettier --write --ignore-unknown grammar.js
2932
3033
- name: Check for changes
3134
uses: tj-actions/verify-changed-files@v19

package-lock.json

Lines changed: 12 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@
3737
"install": "node-gyp-build",
3838
"prestart": "tree-sitter build --wasm",
3939
"start": "tree-sitter playground",
40-
"build": "tree-sitter generate && node-gyp build",
41-
"test": "tree-sitter test && tree-sitter parse examples/*.scala --quiet --time && node --test bindings/node/*_test.js",
42-
"format": "prettier --write --ignore-unknown grammar.js",
43-
"prebuildify": "prebuildify --napi --strip"
40+
"test": "node --test bindings/node/*_test.js"
4441
},
4542
"tree-sitter": [
4643
{

0 commit comments

Comments
 (0)