-
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (76 loc) · 2.59 KB
/
test.yaml
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
name: Test
on:
push:
branches: [main]
paths:
- .github/workflows/**/*.yaml
- autoload/**/*.vim
- plugin/**/*.vim
- scripts/**/*.py
- scripts/**/*.sh
- tests/**/*.vader
pull_request:
branches: [main]
paths:
- .github/workflows/**/*.yaml
- autoload/**/*.vim
- plugin/**/*.vim
- scripts/**/*.py
- scripts/**/*.sh
- tests/**/*.vader
workflow_dispatch:
jobs:
vim-tests:
strategy:
matrix:
os:
- ubuntu-latest
vim:
- version: v9.1.0774
configure_args: --with-features=huge --enable-fail-if-missing --disable-nls
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/cache@v4
id: cache-test-dependencies
with:
path: |
/tmp/vim
/home/runner/vim-${{ matrix.vim.version }}
/home/runner/.vim
/home/runner/vim
key: ${{ matrix.os }}_${{ matrix.vim.version }}
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: rhysd/action-setup-vim@v1.3.5
if: steps.cache-test-dependencies.outputs.cache-hit != 'true'
with:
version: ${{ matrix.vim.version }}
configure-args: ${{ matrix.vim.configure_args }}
- name: Install Vader
if: steps.cache-test-dependencies.outputs.cache-hit != 'true'
run: |
mkdir -vp ~/.vim/plugged
pushd ~/.vim/plugged
git clone https://github.com/junegunn/vader.vim.git
popd
- name: Pre-pend custom Vim install location to `PATH` environment variable
if: steps.cache-test-dependencies.outputs.cache-hit == 'true'
run: |
echo "PATH=$HOME/vim-${{ matrix.vim.version }}/bin:$PATH" >> $GITHUB_ENV
- name: Test units
run: |
scripts/vader-run-tests.sh --test units --cicd > /dev/null
# - name: Test mocks
# run: |
# scripts/vader-run-tests.sh --test mocks --cicd > /dev/null
##
# Attribution:
#
# - https://github.com/junegunn/vader.vim/?tab=readme-ov-file#github-actions
# - https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables
# - https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#matrix-context
# - https://stackoverflow.com/questions/62716758/how-to-extend-environment-variables-in-github-actions-with-existing-ones