-
Notifications
You must be signed in to change notification settings - Fork 17
174 lines (155 loc) Β· 4.47 KB
/
test.yml
File metadata and controls
174 lines (155 loc) Β· 4.47 KB
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
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:
- "2.x"
runs-on: ${{ matrix.runner }}
steps:
- run: git config --global core.autocrlf false
if: runner.os == 'Windows'
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
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
test:
needs: check
strategy:
fail-fast: false
matrix:
runner:
- windows-latest
- macos-latest
- ubuntu-latest
deno_version:
- "~2.3"
- "2.x"
host_version:
- vim: "v9.1.1646"
nvim: "v0.11.3"
runs-on: ${{ matrix.runner }}
timeout-minutes: 15
steps:
- run: |
git config --global core.autocrlf false
git config --global core.eol lf
if: runner.os == 'Windows'
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
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 \
--config ${DENOPS_TEST_DENOPS_PATH}/denops/@denops-private/deno.jsonc \
${DENOPS_TEST_DENOPS_PATH}/denops/@denops-private/mod.ts \
./mod.ts
- name: Test
run: deno task test --coverage=cov
timeout-minutes: 15
- run: |
deno coverage --lcov cov > coverage.lcov
- uses: codecov/codecov-action@v4
with:
os: ${{ runner.os }}
files: ./coverage.lcov
token: ${{ secrets.CODECOV_TOKEN }}
supported-version-check:
strategy:
matrix:
runner:
- ubuntu-latest
deno_version:
- "2.x"
runs-on: ${{ matrix.runner }}
steps:
- run: git config --global core.autocrlf false
if: runner.os == 'Windows'
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
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: 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