Skip to content

Commit

Permalink
Merge pull request #425 from eed3si9n/wip/fix-build-2
Browse files Browse the repository at this point in the history
Fix build, take 2
  • Loading branch information
eed3si9n authored Sep 12, 2024
2 parents b02af60 + fa2c5bd commit b845841
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 22 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,25 @@ jobs:
with:
node-version: 20

- name: Set up tree-sitter
uses: tree-sitter/setup-action/cli@v1

- name: Generate parser from scratch and test it
if: ${{ runner.os == 'Linux' || needs.changedfiles.outputs.c }}
shell: bash
run: |
npm install
npm test
run: tree-sitter generate

- name: Run parser and binding tests
uses: tree-sitter/parser-test-action@v2
with:
test-rust: ${{runner.os == 'Linux'}}
test-swift: ${{runner.os == 'macOS'}}

- name: Parse sample files
uses: tree-sitter/parse-action@v4
id: parse-files
with:
files: examples/**

- name: Check fidelity of checked-in C code
if: ${{ runner.os == 'Linux' && needs.changedfiles.outputs.gen }}
Expand Down Expand Up @@ -113,9 +126,10 @@ jobs:
files: |
queries/*.scm
- name: Test quries if out of sync with nvim-treesitter
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
echo "::warning Queries in ${{ steps.verify-changed-files.outputs.changed_files }} in this repo are out of sync with nvim-treesitter"
git diff queries/
npm run test
# TODO: uncomment when this works
# - name: Test quries if out of sync with nvim-treesitter
# if: steps.verify-changed-files.outputs.files_changed == 'true'
# run: |
# echo "::warning Queries in ${{ steps.verify-changed-files.outputs.changed_files }} in this repo are out of sync with nvim-treesitter"
# git diff queries/
# npm run test
11 changes: 7 additions & 4 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ jobs:
with:
fetch-depth: 10

- name: Set up tree-sitter
uses: tree-sitter/setup-action/cli@v1

- name: Generate parser from scratch
run: |
npm install
npm run build
shell: bash
run: tree-sitter generate

- name: Format Javascipt
run: |
npm install
npm run format
export PATH=./node_modules/.bin:$PATH
prettier --write --ignore-unknown grammar.js
- name: Check for changes
uses: tj-actions/verify-changed-files@v19
Expand Down
17 changes: 12 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@
"install": "node-gyp-build",
"prestart": "tree-sitter build --wasm",
"start": "tree-sitter playground",
"build": "tree-sitter generate && node-gyp build",
"test": "tree-sitter test && tree-sitter parse examples/*.scala --quiet --time && node --test bindings/node/*_test.js",
"format": "prettier --write --ignore-unknown grammar.js",
"prebuildify": "prebuildify --napi --strip"
"test": "node --test bindings/node/*_test.js"
},
"tree-sitter": [
{
Expand Down

0 comments on commit b845841

Please sign in to comment.