Bump unit test dependencies #129
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: (Neo)vim | |
on: | |
push: | |
branches-ignore: | |
- master | |
- 'dependabot/**' | |
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 |