-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (107 loc) · 2.98 KB
/
ci.yml
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
name: CI
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
outputs:
paths: ${{ steps.filter.outputs.paths }}
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
paths:
- '.github/workflows/ci.yml'
- 'after/**'
- 'autoload/**'
- 'plugin/**'
- 'test/**'
tests:
name: '${{ matrix.vim_type }} ${{ matrix.vim_version }} on ${{ matrix.platform }} with cmake ${{ matrix.cmake_version }}'
needs:
- changes
if: ${{ needs.changes.outputs.paths == 'true' }}
strategy:
fail-fast: false
matrix:
vim_type: ['Vim', 'Neovim']
vim_version: ['stable']
cmake_version: [''] # empty means the latest version
platform: ['Linux', 'MacOS', 'Windows']
include:
- platform: 'Linux'
os: 'ubuntu-latest'
- platform: 'MacOS'
os: 'macos-latest'
- platform: 'Windows'
os: 'windows-latest'
- vim_type: 'Vim'
nvim: false
vim_executable: vim
- vim_type: 'Neovim'
nvim: true
vim_executable: nvim
runs-on: '${{ matrix.os }}'
timeout-minutes: 25
steps:
- name: Clone gtest-vim
uses: actions/checkout@v2
- name: Setup python modules
uses: actions/setup-python@master
with:
python-version: 3.7
- name: Install covimerage
run: |
pip3 install 'click<8.0.0'
pip3 install covimerage
pip3 install coveralls
- name: Install vim
uses: rhysd/action-setup-vim@v1
with:
neovim: ${{ matrix.nvim }}
version: ${{ matrix.vim_version }}
- name: Install cmake
uses: jwlawson/actions-setup-cmake@master
with:
cmake-version: ${{ matrix.cmake_version }}
- name: Check cmake
run: |
which cmake
cmake --version
- name: Run tests
run: |
python test/local_run.py --profile --editor ${{ matrix.vim_executable }} --out_dir .
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: coverage
path: ./*.xml
if-no-files-found: error
Report:
runs-on: ubuntu-latest
needs: [tests]
if: ${{ needs.changes.outputs.paths == 'true' }}
steps:
- uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: coverage
path: ./cov_report
- name: Upload coverage to Codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
bash <(curl -s https://codecov.io/bash) $(echo \ `ls -d ./cov_report/*` | sed -r 's/ / -f /g') -Z