-
Notifications
You must be signed in to change notification settings - Fork 3
140 lines (126 loc) · 4.78 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: (Neo)vim
on:
push:
branches-ignore:
- master
pull_request:
branches:
- master
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: 'test/requirements.txt'
- name: Install
run: |
# https://github.com/actions/setup-python/issues/842
pip install --upgrade --force pip setuptools
pip install -r test/requirements.txt
pip install vim-vint
- name: Lint
run: vint autoload ftplugin plugin -wt
- name: Run python tests
run: coverage run -m pytest -v && coverage xml -o pytest.xml
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
file: ./pytest.xml
token: ${{ secrets.CODECOV_TOKEN }}
build:
needs: coverage
runs-on: ubuntu-20.04
strategy:
matrix:
vim-version: [7.4.1689, 8.2.4049, 9.0.0304]
python-version: ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', 'ubuntu']
env:
LOG: python-${{ matrix.python-version }}-bench.log
steps:
- uses: actions/checkout@v4
- name: Set up python
if: ${{ matrix.python-version != 'ubuntu' }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'test/requirements.txt'
- name: Install latest pip
if: ${{ !startsWith(matrix.python-version, '3.5') }}
run: |
pip install --upgrade pip
- name: Install pip < 21.0
if: ${{ startsWith(matrix.python-version, '3.5') }}
run: |
pip install --upgrade 'pip < 21.0'
- name: Install python modules
run: pip install -r test/requirements.txt
- name: Set up plugin test environment
uses: actions/checkout@v4
with:
repository: blueyed/vader.vim
ref: display-source-with-exceptions
path: vader.vim
fetch-depth: 1
- name: Install neovim (current stable)
if: ${{ !(startsWith(matrix.python-version, '3.5') || startsWith(matrix.python-version, '3.6')) }}
uses: rhysd/action-setup-vim@v1
id: neovim-stable
with:
neovim: true
version: stable
- name: Install neovim 0.6.1
uses: rhysd/action-setup-vim@v1
id: neovim
with:
neovim: true
version: 'v0.6.1'
- name: Test plugin on Ubuntu vim
if: ${{ matrix.python-version == 'ubuntu' }}
run: |
sudo apt-get -qq update
sudo apt-get -qqy install vim
vim --startuptime vim_bench.log -ENsu test/vimrc -c '+Vader! test/vader/**/*.vader' > /dev/null
.github/scripts/collect_start_times vim vim-${{ matrix.vim-version }}-$LOG
- name: Test plugin on vim ${{ matrix.vim-version }}
if: ${{ (startsWith(matrix.python-version, '3.5') || startsWith(matrix.python-version, '3.6')) }}
run: |
git clone --branch v${{ matrix.vim-version }} https://github.com/vim/vim.git vim-src
pushd vim-src
git grep -l '# undef _POSIX_THREADS' | xargs -I% sed -i '/# undef _POSIX_THREADS/d' %
CFLAGS=-D_POSIX_THREADS ./configure --prefix=/usr/local --with-features=normal \
--enable-python3interp=dynamic \
--with-python3-config-dir=$(find $Python_ROOT_DIR -iname Makefile | xargs dirname)
make && sudo make install && popd
/usr/local/bin/vim --startuptime vim_bench.log -ENsu test/vimrc -c '+Vader! test/vader/*' > /dev/null
.github/scripts/collect_start_times vim vim-${{ matrix.vim-version }}-$LOG
- name: Test plugin on current stable neovim
if: ${{ !(startsWith(matrix.python-version, '3.5') || startsWith(matrix.python-version, '3.6')) }}
run: |
"${{ steps.neovim-stable.outputs.executable }}" --startuptime nvim_bench.log -ENsu test/vimrc -c '+Vader! test/vader/**/*.vader' > /dev/null
- name: Test plugin on neovim's legacy python providers
if: ${{ (startsWith(matrix.python-version, '3.5') || startsWith(matrix.python-version, '3.6')) }}
run: |
"${{ steps.neovim.outputs.executable }}" --startuptime nvim_bench.log -ENsu test/vimrc -c '+Vader! test/vader/**/*.vader' > /dev/null
- name: Check neovim startup times
run: |
.github/scripts/collect_start_times nvim neovim-$LOG
- name: Save startup times
uses: actions/upload-artifact@v4
with:
name: plugin-load-stats@vim-${{ matrix.vim-version }}-py-${{ matrix.python-version }}
path: '**/*python*.log'
merge:
runs-on: ubuntu-latest
needs: build
steps:
- name: Merge artifacts
uses: actions/upload-artifact/merge@v4
with:
name: plugin-load-stats
delete-merged: true