Skip to content

Commit 84ffe30

Browse files
authored
Merge pull request #31 from vim-denops/improve-ci
☕ Rewrite GitHub Action workflow for deno
2 parents fbdbbc0 + 1a45e01 commit 84ffe30

File tree

1 file changed

+56
-40
lines changed

1 file changed

+56
-40
lines changed

.github/workflows/test.yml

Lines changed: 56 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: Test
22

33
env:
4-
DENO_VERSION: 1.x
54
DENOPS_PATH: "../denops.vim"
65

6+
defaults:
7+
run:
8+
shell: bash --noprofile --norc -eo pipefail {0}
9+
710
on:
811
schedule:
912
- cron: "0 7 * * 0"
@@ -25,47 +28,55 @@ on:
2528
- ".github/workflows/test.yml"
2629

2730
jobs:
28-
typecheck:
29-
runs-on: ubuntu-20.04
30-
31+
check:
32+
strategy:
33+
matrix:
34+
runner:
35+
- windows-latest
36+
- macos-latest
37+
- ubuntu-latest
38+
version:
39+
- "1.11.0"
40+
- "1.x"
41+
runs-on: ${{ matrix.runner }}
3142
steps:
43+
- run: git config --global core.autocrlf false
44+
if: runner.os == 'Windows'
3245
- uses: actions/checkout@v2
3346
- uses: denoland/setup-deno@main
3447
with:
35-
deno-version: ${{ env.DENO_VERSION }}
36-
- name: Type check
37-
run: make type-check
38-
39-
lint:
40-
runs-on: ubuntu-20.04
41-
42-
steps:
43-
- uses: actions/checkout@v2
44-
- uses: denoland/setup-deno@main
45-
with:
46-
deno-version: ${{ env.DENO_VERSION }}
47-
- name: Lint
48+
deno-version: "${{ matrix.version }}"
49+
- name: Lint check
4850
run: make lint
49-
50-
format:
51-
runs-on: ubuntu-20.04
52-
53-
steps:
54-
- uses: actions/checkout@v2
55-
- uses: denoland/setup-deno@main
56-
with:
57-
deno-version: ${{ env.DENO_VERSION }}
58-
- name: Format
51+
- name: Format check
5952
run: make fmt-check
53+
- name: Type check
54+
run: make type-check
6055

6156
test:
62-
runs-on: ubuntu-20.04
63-
64-
defaults:
65-
run:
66-
working-directory: ./repo
67-
57+
strategy:
58+
fail-fast: false
59+
matrix:
60+
runner:
61+
- windows-latest
62+
- macos-latest
63+
- ubuntu-latest
64+
version:
65+
- "1.11.0"
66+
- "1.x"
67+
host_version:
68+
- vim: "v8.1.2424"
69+
nvim: ""
70+
- vim: "v8.2.3081"
71+
nvim: ""
72+
- vim: ""
73+
nvim: "v0.4.4"
74+
- vim: ""
75+
nvim: "v0.5.0"
76+
runs-on: ${{ matrix.runner }}
6877
steps:
78+
- run: git config --global core.autocrlf false
79+
if: runner.os == 'Windows'
6980
- uses: actions/checkout@v2
7081
with:
7182
path: "./repo"
@@ -75,29 +86,34 @@ jobs:
7586
path: "./denops.vim"
7687
- uses: denoland/setup-deno@main
7788
with:
78-
deno-version: ${{ env.DENO_VERSION }}
89+
deno-version: "${{ matrix.version }}"
7990
- uses: rhysd/action-setup-vim@v1
8091
id: vim
8192
with:
82-
version: "v8.1.2424"
83-
- uses: rhysd/action-setup-vim@v1
84-
id: nvim
85-
with:
86-
neovim: true
87-
version: "v0.4.4"
93+
version: "${{ matrix.host_version.vim }}"
94+
if: matrix.host_version.vim != ''
8895
- name: Check Vim
8996
run: |
9097
echo ${DENOPS_TEST_VIM}
9198
${DENOPS_TEST_VIM} --version
9299
env:
93100
DENOPS_TEST_VIM: ${{ steps.vim.outputs.executable }}
101+
if: matrix.host_version.vim != ''
102+
- uses: rhysd/action-setup-vim@v1
103+
id: nvim
104+
with:
105+
neovim: true
106+
version: "${{ matrix.host_version.nvim }}"
107+
if: matrix.host_version.nvim != ''
94108
- name: Check Neovim
95109
run: |
96110
echo ${DENOPS_TEST_NVIM}
97111
${DENOPS_TEST_NVIM} --version
98112
env:
99113
DENOPS_TEST_NVIM: ${{ steps.nvim.outputs.executable }}
114+
if: matrix.host_version.nvim != ''
100115
- name: Test
116+
working-directory: ./repo
101117
run: make test
102118
env:
103119
DENOPS_TEST_VIM: ${{ steps.vim.outputs.executable }}

0 commit comments

Comments
 (0)