Skip to content

CI の修正

CI の修正 #98

Workflow file for this run

name: Test
on:
push:
branches:
- main
pull_request:
paths:
- "**.md"
- "**.ts"
- "**.vim"
- "deno.jsonc"
- ".github/workflows/test.yml"
workflow_dispatch:
inputs:
denops_branch:
description: 'Denops branch to test'
required: false
default: 'main'
defaults:
run:
shell: bash --noprofile --norc -eo pipefail {0}
env:
DENOPS_BRANCH: ${{ github.event.inputs.denops_branch || 'main' }}
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
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 }}