-
Notifications
You must be signed in to change notification settings - Fork 28
118 lines (103 loc) · 3.32 KB
/
test.yml
File metadata and controls
118 lines (103 loc) · 3.32 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
name: Test
on:
push:
branches:
- master
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Vim 7.4
- vim_version: v7.4
make_target: vim/test
test_profile: vim-profile-v7.4.txt
# Vim v8
- vim_version: v8.0.0000
make_target: vim/test
test_profile: vim-profile-v8.0.txt
# Vim master
- vim_version: master
make_target: vim/test
test_profile: vim-profile-master.txt
test_python: python3
# Installed Vim with checks
- vim_version: installed
make_target: fast-test
test_profile: vim-profile-installed.txt
test_python: "python -m coverage run --append"
env:
VIM_VERSION: ${{ matrix.vim_version }}
MAKE_TARGET: ${{ matrix.make_target }}
TEST_PROFILE: ${{ matrix.test_profile }}
TEST_PYTHON: ${{ matrix.test_python }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 10
- name: Install Vim
if: matrix.vim_version != 'installed'
run: |
bash scripts/install-vim.sh
echo "$HOME/vim/bin" >> $GITHUB_PATH
- name: Install Vint
if: matrix.make_target == 'fast-test'
run: |
python -m pip install -q --user flake8 git+https://github.com/Vimjas/vint
- name: Install Covimerage
run: |
python -m pip install -q --user covimerage
python -m pip freeze
- name: Compile js and py
if: matrix.make_target == 'fast-test'
timeout-minutes: 10
run: |
make clean_compiled all
- name: Test
timeout-minutes: 10
run: |
uname -a
which -a vim
vim --version
make --keep-going $MAKE_TARGET
- name: Commit and push
if: success() && matrix.make_target == 'fast-test' && github.ref_name == 'master'
run: |
if ! make fast-check; then
git config --local user.name 'github-actions[bot]'
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin 'https://github-actions:${{ github.token }}@github.com/${{ github.repository }}'
git add js/vimlparser.js py/vimlparser.py
git commit -m 'generate js and py'
git push origin '${{ github.ref_name }}'
fi
- name: Coverage from Python
if: success() && matrix.make_target == 'fast-test'
run: |
# Coverage from Python (cannot be combined with non-branch data).
if [[ -f .coverage_covimerage ]]; then
coverage report -m
coverage xml
fi
- name: Codecov for Python
if: success() && matrix.make_target == 'fast-test'
uses: codecov/codecov-action@v2
with:
files: coverage.xml
flags: python
- name: Coverage from Vim
if: success()
run: |
# Coverage from Vim.
covimerage write_coverage $TEST_PROFILE
coverage report -m
coverage xml
- name: Codecov for Vim
if: success()
uses: codecov/codecov-action@v2
with:
files: coverage.xml
flags: vimscript