Skip to content

Commit b72b872

Browse files
committed
☕ Refine GitHub Action and deno tasks
1 parent 2c73174 commit b72b872

File tree

2 files changed

+36
-27
lines changed

2 files changed

+36
-27
lines changed

.github/workflows/test.yml

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
name: Test
22

33
on:
4-
schedule:
5-
- cron: "0 7 * * 0"
64
push:
75
branches:
86
- main
97
pull_request:
8+
paths:
9+
- "**.md"
10+
- "**.ts"
11+
- "deno.jsonc"
12+
- ".github/workflows/test.yml"
1013
workflow_dispatch:
1114

1215
defaults:
@@ -19,7 +22,7 @@ jobs:
1922
matrix:
2023
runner:
2124
- ubuntu-latest
22-
version:
25+
deno_version:
2326
- "1.x"
2427
runs-on: ${{ matrix.runner }}
2528
steps:
@@ -28,7 +31,7 @@ jobs:
2831
- uses: actions/checkout@v4
2932
- uses: denoland/setup-deno@v1.1.4
3033
with:
31-
deno-version: "${{ matrix.version }}"
34+
deno-version: "${{ matrix.deno_version }}"
3235
- uses: actions/cache@v4
3336
with:
3437
key: deno-${{ hashFiles('**/*') }}
@@ -49,7 +52,7 @@ jobs:
4952
- windows-latest
5053
- macos-latest
5154
- ubuntu-latest
52-
version:
55+
deno_version:
5356
- "1.43.x"
5457
- "1.x"
5558
host_version:
@@ -60,44 +63,51 @@ jobs:
6063
steps:
6164
- run: git config --global core.autocrlf false
6265
if: runner.os == 'Windows'
66+
6367
- uses: actions/checkout@v4
64-
- uses: actions/checkout@v4
65-
with:
66-
repository: "vim-denops/denops.vim"
67-
path: ".deps/denops.vim"
68+
6869
- uses: denoland/setup-deno@v1.1.4
6970
with:
70-
deno-version: "${{ matrix.version }}"
71+
deno-version: "${{ matrix.deno_version }}"
72+
73+
- name: Get denops
74+
run: |
75+
git clone https://github.com/vim-denops/denops.vim /tmp/denops.vim
76+
echo "DENOPS_TEST_DENOPS_PATH=/tmp/denops.vim" >> "$GITHUB_ENV"
77+
7178
- uses: rhysd/action-setup-vim@v1
7279
id: vim
7380
with:
7481
version: "${{ matrix.host_version.vim }}"
75-
- name: Check Vim
76-
run: |
77-
echo ${DENOPS_TEST_VIM}
78-
${DENOPS_TEST_VIM} --version
79-
env:
80-
DENOPS_TEST_VIM: ${{ steps.vim.outputs.executable }}
82+
8183
- uses: rhysd/action-setup-vim@v1
8284
id: nvim
8385
with:
8486
neovim: true
8587
version: "${{ matrix.host_version.nvim }}"
86-
- name: Check Neovim
88+
89+
- name: Export executables
90+
run: |
91+
echo "DENOPS_TEST_VIM_EXECUTABLE=${{ steps.vim.outputs.executable }}" >> "$GITHUB_ENV"
92+
echo "DENOPS_TEST_NVIM_EXECUTABLE=${{ steps.nvim.outputs.executable }}" >> "$GITHUB_ENV"
93+
94+
- name: Check versions
95+
run: |
96+
deno --version
97+
${DENOPS_TEST_VIM_EXECUTABLE} --version
98+
${DENOPS_TEST_NVIM_EXECUTABLE} --version
99+
100+
- name: Perform pre-cache
87101
run: |
88-
echo ${DENOPS_TEST_NVIM}
89-
${DENOPS_TEST_NVIM} --version
90-
env:
91-
DENOPS_TEST_NVIM: ${{ steps.nvim.outputs.executable }}
102+
deno cache ${DENOPS_TEST_DENOPS_PATH}/denops/@denops-private/mod.ts ./mod.ts
103+
92104
- name: Test
93105
run: deno task test:coverage
94-
env:
95-
DENOPS_TEST_DENOPS_PATH: ".deps/denops.vim"
96-
DENOPS_TEST_VIM_EXECUTABLE: ${{ steps.vim.outputs.executable }}
97-
DENOPS_TEST_NVIM_EXECUTABLE: ${{ steps.nvim.outputs.executable }}
98-
timeout-minutes: 5
106+
timeout-minutes: 15
107+
99108
- run: |
100109
deno task coverage --lcov > coverage.lcov
110+
101111
- uses: codecov/codecov-action@v4
102112
with:
103113
os: ${{ runner.os }}

deno.jsonc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"exclude": ["docs/**", ".coverage/**"],
32
"imports": {
43
"https://deno.land/x/denops_std@$MODULE_VERSION/": "./"
54
},

0 commit comments

Comments
 (0)