aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2024-04-14 16:25:28 +0200
committerChristian Clason <c.clason@uni-graz.at>2025-05-12 18:43:40 +0200
commitc17de5689045f75c6244462182ae3b4b62df02d9 (patch)
treeec7785ec523ad4704d09bb5dc5393e1f00046508 /.github
parentfix: vim.tbl_flatten is deprecated (diff)
downloadnvim-treesitter-c17de5689045f75c6244462182ae3b4b62df02d9.tar
nvim-treesitter-c17de5689045f75c6244462182ae3b4b62df02d9.tar.gz
nvim-treesitter-c17de5689045f75c6244462182ae3b4b62df02d9.tar.bz2
nvim-treesitter-c17de5689045f75c6244462182ae3b4b62df02d9.tar.lz
nvim-treesitter-c17de5689045f75c6244462182ae3b4b62df02d9.tar.xz
nvim-treesitter-c17de5689045f75c6244462182ae3b4b62df02d9.tar.zst
nvim-treesitter-c17de5689045f75c6244462182ae3b4b62df02d9.zip
feat!: track parser revision in Lua
Problem: Tracking parser revision in lockfile and allowing override through the parsers module complicates the code. In addition, only revision changes are handled robustly, not changes to other installation info. Solution: Track parser revision in the parsers module directly. Reload parser table on every install or update call. Support modifying parser table in a `User TSUpdate` autocommand.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/tests.yml1
-rw-r--r--.github/workflows/update-lockfile.yml55
-rw-r--r--.github/workflows/update-parsers.yml55
-rw-r--r--.github/workflows/update-readme.yml3
4 files changed, 58 insertions, 56 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 86c7ad630..f78afe711 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -7,6 +7,7 @@ on:
pull_request:
branches:
- "main"
+ workflow_dispatch:
# Cancel any in-progress CI runs for a PR if it is updated
concurrency:
diff --git a/.github/workflows/update-lockfile.yml b/.github/workflows/update-lockfile.yml
deleted file mode 100644
index 70d2c0c0a..000000000
--- a/.github/workflows/update-lockfile.yml
+++ /dev/null
@@ -1,55 +0,0 @@
-name: Update lockfile
-
-on:
- schedule:
- - cron: "30 6 * * 6"
- workflow_dispatch:
-
-jobs:
- update-lockfile:
- name: Update lockfile
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- with:
- ref: main
-
- - uses: actions/create-github-app-token@v2
- id: app-token
- with:
- app-id: ${{ vars.TOKEN_ID }}
- private-key: ${{ secrets.TOKEN_PRIVATE_KEY }}
-
- - name: Prepare
- env:
- NVIM_TAG: nightly
- run: |
- wget https://github.com/josephburnett/jd/releases/download/v1.7.1/jd-amd64-linux
- mv jd-amd64-linux /tmp/jd
- chmod +x /tmp/jd
- bash scripts/ci-install.sh
-
- - name: Update parsers
- env:
- SKIP_LOCKFILE_UPDATE_FOR_LANGS: "bp,devicetree,dhall,elm,enforce,git_config,nickel,rescript,rust,slint,sql,t32,templ,typespec,verilog,wit"
- run: |
- cp lockfile.json /tmp/old_lockfile.json
- nvim -l ./scripts/update-lockfile.lua
- UPDATED_PARSERS=$(/tmp/jd -f merge /tmp/old_lockfile.json lockfile.json | jq -r 'keys | join(", ")')
- echo "UPDATED_PARSERS=$UPDATED_PARSERS" >> $GITHUB_ENV
-
- - name: Create Pull Request
- uses: peter-evans/create-pull-request@v7
- with:
- token: ${{ steps.app-token.outputs.token }}
- sign-commits: true
- commit-message: "bot(lockfile): update ${{ env.UPDATED_PARSERS }}"
- title: "Update lockfile.json: ${{ env.UPDATED_PARSERS }}"
- body: "[beep boop](https://github.com/peter-evans/create-pull-request)"
- branch: update-lockfile-pr
- base: ${{ github.head_ref }}
-
- - name: Enable Pull Request Automerge
- env:
- GH_TOKEN: ${{ steps.app-token.outputs.token }}
- run: gh pr merge --rebase --auto update-lockfile-pr
diff --git a/.github/workflows/update-parsers.yml b/.github/workflows/update-parsers.yml
new file mode 100644
index 000000000..683c732c6
--- /dev/null
+++ b/.github/workflows/update-parsers.yml
@@ -0,0 +1,55 @@
+name: Update parsers
+
+on:
+ schedule:
+ - cron: "30 6 * * *"
+ workflow_dispatch:
+
+env:
+ BIN_DIR: ${{ github.workspace }}/bin
+
+jobs:
+ update-parsers:
+ name: Update parsers
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ ref: main
+
+ - uses: actions/create-github-app-token@v2
+ id: app-token
+ with:
+ app-id: ${{ vars.TOKEN_ID }}
+ private-key: ${{ secrets.TOKEN_PRIVATE_KEY }}
+
+ - name: Add $BIN_DIR to PATH
+ run: echo "$BIN_DIR" >> $GITHUB_PATH
+
+ - name: Prepare
+ env:
+ NVIM_TAG: nightly
+ run: |
+ bash scripts/ci-install.sh
+ wget --directory-prefix="$BIN_DIR" https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-linux-x86_64.zip
+ (cd "$BIN_DIR"; unzip stylua*.zip)
+
+ - name: Update parsers
+ run: ./scripts/update-parsers.lua
+
+ - name: Create Pull Request
+ uses: peter-evans/create-pull-request@v7
+ with:
+ add-paths: lua/nvim-treesitter/parsers.lua
+ token: ${{ steps.app-token.outputs.token }}
+ sign-commits: true
+ commit-message: "bot(parsers): update ${{ env.UPDATED_PARSERS }}"
+ title: "Update parsers: ${{ env.UPDATED_PARSERS }}"
+ body: "[beep boop](https://github.com/peter-evans/create-pull-request)"
+ branch: update-parsers-pr
+ base: ${{ github.head_ref }}
+
+ - name: Enable Pull Request Automerge
+ env:
+ GH_TOKEN: ${{ steps.app-token.outputs.token }}
+ run: gh pr merge --rebase --auto update-parsers-pr
diff --git a/.github/workflows/update-readme.yml b/.github/workflows/update-readme.yml
index 849bb9814..335756619 100644
--- a/.github/workflows/update-readme.yml
+++ b/.github/workflows/update-readme.yml
@@ -32,10 +32,11 @@ jobs:
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
+ add-paths: SUPPORTED_LANGUAGES.md
token: ${{ steps.app-token.outputs.token }}
sign-commits: true
commit-message: "bot(readme): update"
- title: Update README
+ title: Update SUPPORTED_LANGUAGES.md
body: "[beep boop](https://github.com/peter-evans/create-pull-request)"
branch: update-readme-pr
base: ${{ github.head_ref }}