Skip to content

Merge pull request #273 from mityu/fix-helper-input-cancellation #986

Merge pull request #273 from mityu/fix-helper-input-cancellation

Merge pull request #273 from mityu/fix-helper-input-cancellation #986

Workflow file for this run

name: Test
on:
push:
branches:
- main
pull_request:
paths:
- "**.md"
- "**.ts"
- "deno.jsonc"
- ".github/workflows/test.yml"
workflow_dispatch:
inputs:
denops_branch:
description: 'Denops revision to test'
required: false
default: 'main'
verbose:
type: boolean
required: false
description: 'Enable verbose output'
default: false
defaults:
run:
shell: bash --noprofile --norc -eo pipefail {0}
env:
DENOPS_BRANCH: ${{ github.event.inputs.denops_branch || 'main' }}
DENOPS_TEST_VERBOSE: ${{ github.event.inputs.verbose }}
jobs:
check:
strategy:
matrix:
runner:
- ubuntu-latest
deno_version:
- "1.x"
runs-on: ${{ matrix.runner }}
steps:
- run: git config --global core.autocrlf false
if: runner.os == 'Windows'
- uses: actions/checkout@v4
- uses: denoland/[email protected]
with:
deno-version: "${{ matrix.deno_version }}"
- uses: actions/cache@v4
with:
key: deno-${{ hashFiles('**/*') }}
restore-keys: deno-
path: |
/home/runner/.cache/deno/deps/https/deno.land
- name: Lint check
run: deno lint
- name: Format check
run: deno fmt --check
- name: Type check
run: deno task check
- name: Doc check
run: deno task check:doc
- name: Gen check
run: |
deno task gen
git diff --exit-code
- name: Supported version inconsistency check
run: |
deno task apply:supported-versions
git diff --exit-code
test:
strategy:
matrix:
runner:
- windows-latest
- macos-latest
- ubuntu-latest
deno_version:
- "1.45.0"
- "1.x"
host_version:
- vim: "v9.1.0448"
nvim: "v0.10.0"
runs-on: ${{ matrix.runner }}
timeout-minutes: 15
steps:
- run: git config --global core.autocrlf false
if: runner.os == 'Windows'
- uses: actions/checkout@v4
- uses: denoland/[email protected]
with:
deno-version: "${{ matrix.deno_version }}"
- name: Get denops
run: |
git clone https://github.com/vim-denops/denops.vim /tmp/denops.vim
echo "DENOPS_TEST_DENOPS_PATH=/tmp/denops.vim" >> "$GITHUB_ENV"
- name: Try switching denops branch
run: |
git -C /tmp/denops.vim switch ${{ env.DENOPS_BRANCH }} || true
git -C /tmp/denops.vim branch
- uses: rhysd/action-setup-vim@v1
id: vim
with:
version: "${{ matrix.host_version.vim }}"
- uses: rhysd/action-setup-vim@v1
id: nvim
with:
neovim: true
version: "${{ matrix.host_version.nvim }}"
- name: Export executables
run: |
echo "DENOPS_TEST_VIM_EXECUTABLE=${{ steps.vim.outputs.executable }}" >> "$GITHUB_ENV"
echo "DENOPS_TEST_NVIM_EXECUTABLE=${{ steps.nvim.outputs.executable }}" >> "$GITHUB_ENV"
- name: Check versions
run: |
deno --version
${DENOPS_TEST_VIM_EXECUTABLE} --version
${DENOPS_TEST_NVIM_EXECUTABLE} --version
- name: Perform pre-cache
run: |
deno cache ${DENOPS_TEST_DENOPS_PATH}/denops/@denops-private/mod.ts ./mod.ts
- name: Test
run: deno task test:coverage
timeout-minutes: 15
- run: |
deno task coverage --lcov > coverage.lcov
- uses: codecov/codecov-action@v4
with:
os: ${{ runner.os }}
files: ./coverage.lcov
token: ${{ secrets.CODECOV_TOKEN }}
jsr-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: ${{ env.DENO_VERSION }}
- name: Publish (dry-run)
run: |
deno publish --dry-run