-
-
Notifications
You must be signed in to change notification settings - Fork 9
133 lines (115 loc) · 3.39 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
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"
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'
- run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git version
- 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 ./denops/gin/main.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 }}