diff options
| author | Searidang Pa <dangsyncpa@gmail.com> | 2026-01-09 21:49:03 -0500 |
|---|---|---|
| committer | Searidang Pa <dangsyncpa@gmail.com> | 2026-01-09 21:49:03 -0500 |
| commit | 3c7b04bd814fb6089691e3b57c410b6370e672d3 (patch) | |
| tree | da7ce8b12dfb5452610f56144d27b5b7cbaf5cf9 /.github | |
| parent | 2832ee20c45652415cf58acf2aff03041864b573 (diff) | |
| download | a4-3c7b04bd814fb6089691e3b57c410b6370e672d3.tar.xz a4-3c7b04bd814fb6089691e3b57c410b6370e672d3.zip | |
ci: cache tree-sitter installs; wait for parsers
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/makefile.yml | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml index 6ea92c7..4e1aad3 100644 --- a/.github/workflows/makefile.yml +++ b/.github/workflows/makefile.yml @@ -11,12 +11,18 @@ jobs: runs-on: ubuntu-latest + env: + NVIM_VERSION: v0.10.3 + NVIM_TREESITTER_SHA: 2ba5ec184609a96b513bf4c53a20512d64e27f39 + XDG_DATA_HOME: ${{ github.workspace }}/.xdg/data + XDG_CACHE_HOME: ${{ github.workspace }}/.xdg/cache + steps: - uses: actions/checkout@v4 - name: Install Neovim run: | - wget -q https://github.com/neovim/neovim/releases/download/v0.10.3/nvim-linux64.tar.gz + wget -q https://github.com/neovim/neovim/releases/download/${NVIM_VERSION}/nvim-linux64.tar.gz tar xzf nvim-linux64.tar.gz sudo mv nvim-linux64 /opt/nvim sudo ln -s /opt/nvim/bin/nvim /usr/local/bin/nvim @@ -36,6 +42,12 @@ jobs: chmod +x stylua sudo mv stylua /usr/local/bin/ + - name: Cache Neovim data (tree-sitter) + uses: actions/cache@v4 + with: + path: .xdg + key: ${{ runner.os }}-nvim-${{ env.NVIM_VERSION }}-ts-${{ env.NVIM_TREESITTER_SHA }} + - name: Install plenary.nvim run: | git clone https://github.com/nvim-lua/plenary.nvim.git ../plenary.nvim @@ -43,16 +55,16 @@ jobs: - name: Install nvim-treesitter (pinned) run: | git clone https://github.com/nvim-treesitter/nvim-treesitter.git ../nvim-treesitter - git -C ../nvim-treesitter checkout 2ba5ec184609a96b513bf4c53a20512d64e27f39 + git -C ../nvim-treesitter checkout ${NVIM_TREESITTER_SHA} - name: Install treesitter parsers run: | - nvim --headless \ + nvim --headless -u NONE -i NONE \ -c "set rtp+=../nvim-treesitter" \ - -c "runtime plugin/nvim-treesitter.lua" \ - -c "TSInstall lua typescript" \ - -c "lua vim.wait(60000, function() local ok1 = pcall(vim.treesitter.language.inspect, 'lua'); local ok2 = pcall(vim.treesitter.language.inspect, 'typescript'); return ok1 and ok2 end, 1000)" \ - -c "quit" + -c "lua require('nvim-treesitter').install({ 'lua', 'typescript' }):wait(300000)" \ + -c "lua assert(#vim.api.nvim_get_runtime_file('parser/lua.so', true) > 0, 'lua parser missing after install')" \ + -c "lua assert(#vim.api.nvim_get_runtime_file('parser/typescript.so', true) > 0, 'typescript parser missing after install')" \ + -c "qa" - name: Run pr_ready run: make pr_ready |
