From 05299344fc943c6a5e2b15f0ffdab1b241e46ff5 Mon Sep 17 00:00:00 2001 From: Ziwei Wang Date: Tue, 30 Jul 2024 12:14:27 -0400 Subject: [PATCH] Chore: Update CI, scripts and README on wasm We no longer track and update the wasm files in our project, related terms on wasm should be updated. --- ... => update-tree-sitter-parser-info-file.yml} | 17 +++++++---------- README-DEVELOPER.md | 2 +- scripts/update-tree-sitter-bash-wasm.sh | 9 --------- scripts/update-tree-sitter-bash.sh | 9 +++++++++ scripts/update-tree-sitter-bitbake-wasm.sh | 9 --------- scripts/update-tree-sitter-bitbake.sh | 9 +++++++++ ...ree-sitter-wasm.sh => update-tree-sitter.sh} | 2 +- 7 files changed, 27 insertions(+), 30 deletions(-) rename .github/workflows/{update-tree-sitter-wasm-file.yml => update-tree-sitter-parser-info-file.yml} (71%) delete mode 100644 scripts/update-tree-sitter-bash-wasm.sh create mode 100644 scripts/update-tree-sitter-bash.sh delete mode 100644 scripts/update-tree-sitter-bitbake-wasm.sh create mode 100644 scripts/update-tree-sitter-bitbake.sh rename scripts/{update-tree-sitter-wasm.sh => update-tree-sitter.sh} (95%) diff --git a/.github/workflows/update-tree-sitter-wasm-file.yml b/.github/workflows/update-tree-sitter-parser-info-file.yml similarity index 71% rename from .github/workflows/update-tree-sitter-wasm-file.yml rename to .github/workflows/update-tree-sitter-parser-info-file.yml index a8b4beef..61f3352c 100644 --- a/.github/workflows/update-tree-sitter-wasm-file.yml +++ b/.github/workflows/update-tree-sitter-parser-info-file.yml @@ -1,7 +1,7 @@ # Inspired by bash-language-server under MIT license # Reference: https://github.com/bash-lsp/bash-language-server/blob/8c42218c77a9451b308839f9a754abde901323d5/.github/workflows/upgrade-tree-sitter.yml -name: Update Tree Sitter WASM File +name: Update Tree Sitter Parser Info File on: workflow_dispatch: @@ -9,7 +9,7 @@ on: - cron: '0 12 * * 2' jobs: - update-tree-sitter-wasm: + update-tree-sitter-parser-info-file: runs-on: ubuntu-latest @@ -45,15 +45,13 @@ jobs: - name: Install Dependencies run: npm install - - name: Update tree-sitter wasm - run: bash scripts/update-${{ matrix.tree-sitter-name }}-wasm.sh + - name: Update tree-sitter parser info file + run: bash scripts/update-${{ matrix.tree-sitter-name }}.sh - name: Verify file changes uses: tj-actions/verify-changed-files@v20 id: verify-changed-files with: - # The script generates a new wasm file and replaces the existing one. Git will treat it as a different file even it is generated with the same commit and CLI - # Hence, we only compare the .info file. It should be enough to tell the difference files: | server/${{ matrix.tree-sitter-name }}.info @@ -63,9 +61,8 @@ jobs: with: add-paths: | server/${{ matrix.tree-sitter-name }}.info - server/${{ matrix.tree-sitter-name }}.wasm - title: Auto update ${{ matrix.tree-sitter-name }} wasm file - commit-message: Auto update ${{ matrix.tree-sitter-name }} wasm file and parser info - branch: update-${{ matrix.tree-sitter-name }}-wasm-file + title: Auto update ${{ matrix.tree-sitter-name }} parser info file + commit-message: Auto update ${{ matrix.tree-sitter-name }} parser info + branch: update-${{ matrix.tree-sitter-name }}-parser-info-file base: ${{ env.BASE_BRANCH }} token: ${{ secrets.GITHUB_TOKEN }} diff --git a/README-DEVELOPER.md b/README-DEVELOPER.md index ef0feb4b..781ffa24 100644 --- a/README-DEVELOPER.md +++ b/README-DEVELOPER.md @@ -93,7 +93,7 @@ See [the individual integration tests README](integration-tests/README.md). ## Tree-sitter This extension uses [tree-sitter-bitbake](https://github.com/tree-sitter-grammars/tree-sitter-bitbake) and [tree-sitter-bash](https://github.com/tree-sitter/tree-sitter-bash) to parse the BitBake documents. They are installed with `npm run fetch:wasm`. The versions of tree-sitter-bitbake and tree-sitter-bash are documented in [server/tree-sitter-bitbake.info](server/tree-sitter-bitbake.info) and [server/tree-sitter-bash.info](server/tree-sitter-bash.info) respectively, along with the versions of the tree-sitter-cli that have to be used. -To update the .info files with the latest versions of tree-sitter-bitbake and tree-sitter-bash, it is recommended to use the scripts [scripts/update-tree-sitter-bitbake-wasm.sh](scripts/update-tree-sitter-bitbake-wasm.sh) and [scripts/update-tree-sitter-bash-wasm.sh](scripts/update-tree-sitter-bash-wasm.sh). The GitHub workflow [update-tree-sitter-wasm-file.yml](.github/workflows/update-tree-sitter-wasm-file.yml) is already responsible for doing it automatically. +To update the .info files with the latest versions of tree-sitter-bitbake and tree-sitter-bash, it is recommended to use the scripts [scripts/update-tree-sitter-bitbake.sh](scripts/update-tree-sitter-bitbake.sh) and [scripts/update-tree-sitter-bash.sh](scripts/update-tree-sitter-bash.sh). The GitHub workflow [update-tree-sitter-parser-info-file.yml](.github/workflows/update-tree-sitter-parser-info-file.yml) is already responsible for doing it automatically. After updating the .info files, it is required to call `npm run fetch:wasm` in order to rebuild the Wasm files. diff --git a/scripts/update-tree-sitter-bash-wasm.sh b/scripts/update-tree-sitter-bash-wasm.sh deleted file mode 100644 index aacebbd7..00000000 --- a/scripts/update-tree-sitter-bash-wasm.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -set -e - -. "$(dirname "$0")/update-tree-sitter-wasm.sh" - -repo_name=tree-sitter-bash -repo_owner=tree-sitter - -update-tree-sitter-wasm $repo_name $repo_owner diff --git a/scripts/update-tree-sitter-bash.sh b/scripts/update-tree-sitter-bash.sh new file mode 100644 index 00000000..f2f230e0 --- /dev/null +++ b/scripts/update-tree-sitter-bash.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -e + +. "$(dirname "$0")/update-tree-sitter.sh" + +repo_name=tree-sitter-bash +repo_owner=tree-sitter + +update-tree-sitter $repo_name $repo_owner diff --git a/scripts/update-tree-sitter-bitbake-wasm.sh b/scripts/update-tree-sitter-bitbake-wasm.sh deleted file mode 100644 index 190c679e..00000000 --- a/scripts/update-tree-sitter-bitbake-wasm.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -set -e - -. "$(dirname "$0")/update-tree-sitter-wasm.sh" - -repo_name=tree-sitter-bitbake -repo_owner=tree-sitter-grammars - -update-tree-sitter-wasm $repo_name $repo_owner diff --git a/scripts/update-tree-sitter-bitbake.sh b/scripts/update-tree-sitter-bitbake.sh new file mode 100644 index 00000000..7d34c28c --- /dev/null +++ b/scripts/update-tree-sitter-bitbake.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -e + +. "$(dirname "$0")/update-tree-sitter.sh" + +repo_name=tree-sitter-bitbake +repo_owner=tree-sitter-grammars + +update-tree-sitter $repo_name $repo_owner diff --git a/scripts/update-tree-sitter-wasm.sh b/scripts/update-tree-sitter.sh similarity index 95% rename from scripts/update-tree-sitter-wasm.sh rename to scripts/update-tree-sitter.sh index e714ab1e..1bb6fa72 100755 --- a/scripts/update-tree-sitter-wasm.sh +++ b/scripts/update-tree-sitter.sh @@ -5,7 +5,7 @@ set -euox pipefail -update-tree-sitter-wasm() { +update-tree-sitter() { local repo_name=$1 local repo_owner=$2 local info_file="$repo_name.info"