From 476f342fe6bc1e120ba3e334b5d9cf3ef66de56a Mon Sep 17 00:00:00 2001 From: Phred Lane Date: Sun, 21 Dec 2025 18:19:10 -0600 Subject: [PATCH] chore: used native action-centric methods for testing (#2856) * chore: used native action-centric methods for testing * pass the GitHub token to the `gh` cli --- .github/workflows/lua.yaml | 42 ++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/.github/workflows/lua.yaml b/.github/workflows/lua.yaml index c9778b4..65b7349 100644 --- a/.github/workflows/lua.yaml +++ b/.github/workflows/lua.yaml @@ -6,13 +6,13 @@ on: - main paths: - "**/*.lua" - - ".github/workflows/lua.yaml" + - .github/workflows/lua.yaml pull_request: branches: - main paths: - "**/*.lua" - - ".github/workflows/lua.yaml" + - .github/workflows/lua.yaml jobs: # reference from: https://github.com/nvim-lua/plenary.nvim/blob/2d9b06177a975543726ce5c73fca176cedbffe9d/.github/workflows/default.yml#L6C3-L43C20 @@ -24,30 +24,43 @@ jobs: matrix: include: - os: ubuntu-22.04 - rev: v0.10.0/nvim-linux64.tar.gz + rev: v0.10.0 steps: - - uses: actions/checkout@v3 - - run: date +%F > todays-date + - uses: actions/checkout@v6 + + - id: todays-date + run: echo "date=$(date +%F)" >> "$GITHUB_OUTPUT" + - name: Restore cache for today's nightly. - uses: actions/cache@v3 + id: cache-neovim + uses: actions/cache@v4 with: path: _neovim - key: ${{ runner.os }}-${{ matrix.rev }}-${{ hashFiles('todays-date') }} + key: ${{ runner.os }}-${{ matrix.rev }}-${{ steps.todays-date.outputs.date }} + + - name: Download neovim ${{ matrix.rev }} + env: + GH_TOKEN: ${{ github.token }} + NEOVIM_VERSION: ${{ matrix.rev }} + if: steps.cache-neovim.outputs.cache-hit != 'true' + run: | + mkdir -p _neovim + gh release download \ + --output - \ + --pattern nvim-linux64.tar.gz \ + --repo neovim/neovim \ + "$NEOVIM_VERSION" | tar xvz --strip-components 1 --directory _neovim - name: Prepare run: | - test -d _neovim || { - mkdir -p _neovim - curl -sL "https://github.com/neovim/neovim/releases/download/${{ matrix.rev }}" | tar xzf - --strip-components=1 -C "${PWD}/_neovim" - } sudo apt-get update sudo apt-get install -y ripgrep sudo apt-get install -y silversearcher-ag + echo "${PWD}/_neovim/bin" >> "$GITHUB_PATH" + echo VIM="${PWD}/_neovim/share/nvim/runtime" >> "$GITHUB_ENV" - name: Run tests run: | - export PATH="${PWD}/_neovim/bin:${PATH}" - export VIM="${PWD}/_neovim/share/nvim/runtime" nvim --version make luatest @@ -59,8 +72,7 @@ jobs: nvim_version: [ stable ] luals_version: [ 3.13.6 ] steps: - - name: Checkout Code - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - uses: rhysd/action-setup-vim@v1 with: