Files
nvim-treesitter/.github/workflows/update-parsers.yml
Christian Clason 53dccb3a77 feat(tests)!: new infrastructure based on makefile
Problem: Not easy to run all checks and tests locally. Redundant CI
workflows.

Solution: Separate CI into two workflows:
 * lint: Lua files (stylua, luals), query files (valid captures,
   predicates, directives using tsqueryls), docs
   (SUPPORTED_LANGUAGES.md) -- does not need parser installation
 * tests: parsers (ABI compatibility), query files (tsqueryls on
   Linux/macOS; nvim on Windows), highlight and indent tests (separated
   for better readability) -- needs parser installation (but only once)

Switch to https://github.com/nvim-treesitter/highlight-assertions fork
with ABI 15 support.

Run all tests (on Linux and macOS) through `make` (`formatlua`,
`checklua`, `lintquery`, `formatquery`, `checkquery`, `docs`, `tests`),
which downloads and caches all necessary dependencies.

Remove `update-readme` workflow (replaced by lint job on PRs).
2025-05-12 18:43:41 +02:00

56 lines
1.6 KiB
YAML

name: Update parsers
on:
schedule:
- cron: "30 6 * * 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