diff --git a/.github/workflows/nightly-check.yml b/.github/workflows/nightly-check.yml index 14826ddb..e208fa5a 100644 --- a/.github/workflows/nightly-check.yml +++ b/.github/workflows/nightly-check.yml @@ -2,9 +2,10 @@ name: Nightly Neovim check # Checks LSP and unit tests against new Neovim nightly once a week on: - schedule: - - cron: '30 21 * * 0' # 6:30 AM JST, Monday - workflow_dispatch: + # schedule: + # - cron: '30 21 * * 0' # 6:30 AM JST, Monday + # workflow_dispatch: + push: concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -12,23 +13,30 @@ concurrency: jobs: tests: - name: unit tests - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Prepare - run: | - test -d _neovim || { - mkdir -p _neovim - curl -sL "https://github.com/neovim/neovim/releases/download/v0.9.1/nvim-linux64.tar.gz" | tar xzf - --strip-components=1 -C "${PWD}/_neovim" - } - - - name: Run tests - run: | - export PATH="${PWD}/_neovim/bin:${PATH}" - export VIM="${PWD}/_neovim/share/nvim/runtime" - nvim --version - make test + uses: ./.github/workflows/tests.yml + with: + matrix: | + [ + {"rev": "nightly/nvim-linux64.tar.gz"} + ] + # tests: + # name: unit tests + # runs-on: ubuntu-22.04 + # steps: + # - uses: actions/checkout@v3 + # - name: Prepare + # run: | + # test -d _neovim || { + # mkdir -p _neovim + # curl -sL "https://github.com/neovim/neovim/releases/download/v0.9.1/nvim-linux64.tar.gz" | tar xzf - --strip-components=1 -C "${PWD}/_neovim" + # } + # + # - name: Run tests + # run: | + # export PATH="${PWD}/_neovim/bin:${PATH}" + # export VIM="${PWD}/_neovim/share/nvim/runtime" + # nvim --version + # make test lua-language-server: name: lua language server diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index 4e4fb235..39e9a532 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -1,7 +1,8 @@ name: Pull request check on: - pull_request: + push: + # pull_request: concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -9,37 +10,13 @@ concurrency: jobs: tests: - name: unit tests - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - include: - - version: nightly - rev: nightly/nvim-linux64.tar.gz - - version: stable - rev: v0.9.2/nvim-linux64.tar.gz - steps: - - uses: actions/checkout@v3 - - run: date +%F > todays-date - - name: Restore cache for today's nightly. - uses: actions/cache@v3 - with: - path: _neovim - key: ${{ matrix.rev }}-${{ hashFiles('todays-date') }} - - 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" - } - - - name: Run tests - run: | - export PATH="${PWD}/_neovim/bin:${PATH}" - export VIM="${PWD}/_neovim/share/nvim/runtime" - nvim --version - make test + uses: ./.github/workflows/tests.yml + with: + matrix: | + [ + {"rev": "nightly/nvim-linux64.tar.gz"}, + {"rev": "v0.9.2/nvim-linux64.tar.gz"} + ] lua-language-server: name: lua language server diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..9a3e4f92 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,38 @@ +name: Run tests + +on: + workflow_call: + inputs: + matrix: + required: true + type: string + +jobs: + tests: + name: unit tests + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + include: ${{ fromJson(inputs.matrix) }} + steps: + - uses: actions/checkout@v3 + - run: date +%F > todays-date + - name: Restore cache for today's nightly. + uses: actions/cache@v3 + with: + path: _neovim + key: ${{ matrix.rev }}-${{ hashFiles('todays-date') }} + - 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" + } + + - name: Run tests + run: | + export PATH="${PWD}/_neovim/bin:${PATH}" + export VIM="${PWD}/_neovim/share/nvim/runtime" + nvim --version + make test