Skip to content

Commit 0483eb2

Browse files
committed
☕ Rewrite test.yml to improve CI
1 parent 16646fe commit 0483eb2

File tree

1 file changed

+33
-45
lines changed

1 file changed

+33
-45
lines changed

.github/workflows/test.yml

Lines changed: 33 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ name: Test
22

33
env:
44
DENOPS_PATH: "../denops.vim"
5-
6-
defaults:
7-
run:
8-
shell: bash --noprofile --norc -eo pipefail {0}
5+
DENO_DIR: ".deno"
96

107
on:
118
schedule:
@@ -16,17 +13,17 @@ on:
1613
paths:
1714
- "**/*.md"
1815
- "**/*.ts"
19-
- "denops_std/modules-lock.json"
2016
- ".github/workflows/test.yml"
2117
pull_request:
22-
branches:
23-
- main
2418
paths:
2519
- "**/*.md"
2620
- "**/*.ts"
27-
- "denops_std/modules-lock.json"
2821
- ".github/workflows/test.yml"
2922

23+
defaults:
24+
run:
25+
shell: bash --noprofile --norc -eo pipefail {0}
26+
3027
jobs:
3128
check:
3229
strategy:
@@ -41,9 +38,16 @@ jobs:
4138
- run: git config --global core.autocrlf false
4239
if: runner.os == 'Windows'
4340
- uses: actions/checkout@v2
44-
- uses: denoland/setup-deno@main
41+
- uses: denoland/setup-deno@v1
4542
with:
4643
deno-version: "${{ matrix.version }}"
44+
- uses: actions/cache@v2
45+
with:
46+
path: ${{ env.DENO_DIR }}
47+
key: ${{ runner.os }}-deno-${{ matrix.version }}-${{ hashFiles('**/*.ts') }}
48+
restore-keys: |
49+
${{ runner.os }}-deno-${{ matrix.version }}-
50+
${{ runner.os }}-deno-
4751
- name: Lint check
4852
run: make lint
4953
- name: Format check
@@ -66,28 +70,6 @@ jobs:
6670
nvim: "v0.4.4"
6771
- vim: "v8.2.3081"
6872
nvim: "v0.5.0"
69-
include:
70-
- runner: windows-latest
71-
version: 1.11.0
72-
host_version:
73-
vim: v8.2.0671 # Instead of v8.2.0662
74-
nvim: v0.4.4
75-
- runner: windows-latest
76-
version: 1.x
77-
host_version:
78-
vim: v8.2.0671 # Instead of v8.2.0662
79-
nvim: v0.4.4
80-
exclude:
81-
- runner: windows-latest
82-
version: 1.11.0
83-
host_version:
84-
vim: v8.2.0662 # Not found on vim-win32-installer
85-
nvim: v0.4.4
86-
- runner: windows-latest
87-
version: 1.x
88-
host_version:
89-
vim: v8.2.0662 # Not found on vim-win32-installer
90-
nvim: v0.4.4
9173
runs-on: ${{ matrix.runner }}
9274
steps:
9375
- run: git config --global core.autocrlf false
@@ -99,38 +81,44 @@ jobs:
9981
with:
10082
repository: "vim-denops/denops.vim"
10183
path: "./denops.vim"
102-
- uses: denoland/setup-deno@main
84+
- uses: denoland/setup-deno@v1
10385
with:
10486
deno-version: "${{ matrix.version }}"
105-
- uses: rhysd/action-setup-vim@v1
87+
- uses: actions/cache@v2
88+
id: cache
89+
with:
90+
path: ${{ env.DENO_DIR }}
91+
key: ${{ runner.os }}-deno-${{ matrix.version }}-${{ hashFiles('**/*.ts') }}
92+
restore-keys: |
93+
${{ runner.os }}-deno-${{ matrix.version }}-
94+
${{ runner.os }}-deno-
95+
- uses: thinca/action-setup-vim@v1
10696
id: vim
10797
with:
108-
version: "${{ matrix.host_version.vim }}"
109-
if: matrix.host_version.vim != ''
98+
vim_type: "Vim"
99+
vim_version: "${{ matrix.host_version.vim }}"
100+
download: "never"
110101
- name: Check Vim
111102
run: |
112103
echo ${DENOPS_TEST_VIM}
113104
${DENOPS_TEST_VIM} --version
114105
env:
115-
DENOPS_TEST_VIM: ${{ steps.vim.outputs.executable }}
116-
if: matrix.host_version.vim != ''
117-
- uses: rhysd/action-setup-vim@v1
106+
DENOPS_TEST_VIM: ${{ steps.vim.outputs.executable_path }}
107+
- uses: thinca/action-setup-vim@v1
118108
id: nvim
119109
with:
120-
neovim: true
121-
version: "${{ matrix.host_version.nvim }}"
122-
if: matrix.host_version.nvim != ''
110+
vim_type: "Neovim"
111+
vim_version: "${{ matrix.host_version.nvim }}"
123112
- name: Check Neovim
124113
run: |
125114
echo ${DENOPS_TEST_NVIM}
126115
${DENOPS_TEST_NVIM} --version
127116
env:
128-
DENOPS_TEST_NVIM: ${{ steps.nvim.outputs.executable }}
129-
if: matrix.host_version.nvim != ''
117+
DENOPS_TEST_NVIM: ${{ steps.nvim.outputs.executable_path }}
130118
- name: Test
131119
working-directory: ./repo
132120
run: make test
133121
env:
134-
DENOPS_TEST_VIM: ${{ steps.vim.outputs.executable }}
135-
DENOPS_TEST_NVIM: ${{ steps.nvim.outputs.executable }}
122+
DENOPS_TEST_VIM: ${{ steps.vim.outputs.executable_path }}
123+
DENOPS_TEST_NVIM: ${{ steps.nvim.outputs.executable_path }}
136124
timeout-minutes: 5

0 commit comments

Comments
 (0)