-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #580 from bash-lsp/upgrade-tree-sitter-workflow
Upgrade tree-sitter GitHub workflow
- Loading branch information
Showing
3 changed files
with
54 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
on: | ||
schedule: | ||
- cron: '0 12 * * 2' | ||
|
||
jobs: | ||
upgrade_tree_sitter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js 12 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 12 | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Upgrade tree-sitter wasm | ||
run: sh scripts/upgrade-tree-sitter.sh | ||
|
||
- name: Verify changes | ||
run: yarn verify:bail | ||
|
||
- name: Verify file changes | ||
uses: tj-actions/verify-changed-files@v12 | ||
id: verify-changed-files | ||
with: | ||
files: | | ||
server/parser.info | ||
server/tree-sitter-bash.wasm | ||
- name: Create pull request | ||
if: steps.verify-changed-files.outputs.files_changed == 'true' | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
add-paths: server | ||
reviewers: skovhus | ||
title: Auto upgrade tree-sitter-bash parser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euox pipefail | ||
|
||
cd server | ||
yarn add web-tree-sitter | ||
yarn add --dev tree-sitter-cli https://github.com/tree-sitter/tree-sitter-bash | ||
npx tree-sitter build-wasm node_modules/tree-sitter-bash | ||
|
||
curl 'https://api.github.com/repos/tree-sitter/tree-sitter-bash/commits/master' | jq .commit.url > parser.info | ||
echo "tree-sitter-cli $(cat package.json | jq '.devDependencies["tree-sitter-cli"]')" >> parser.info | ||
|
||
yarn remove tree-sitter-cli tree-sitter-bash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters