Skip to content

Commit 806f4a4

Browse files
committed
ci: run tests on GitHub Actions
1 parent dd540b0 commit 806f4a4

File tree

5 files changed

+97
-45
lines changed

5 files changed

+97
-45
lines changed

.github/workflows/test.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: test
2+
on:
3+
push:
4+
pull_request:
5+
branches:
6+
- 'master'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.repository_owner == 'neovim' && github.sha || github.ref_name }}
10+
cancel-in-progress: true
11+
12+
env:
13+
PYTEST_ADDOPTS: '-vv'
14+
15+
jobs:
16+
test:
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
node: ['3.11', '3.12']
21+
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
22+
include:
23+
- os: ubuntu-latest
24+
NIGHTLY: nvim-linux64.tar.gz
25+
NVIM_BIN_PATH: nvim-linux64/bin
26+
EXTRACT: tar xzf
27+
- os: macos-latest
28+
NIGHTLY: nvim-macos.tar.gz
29+
NVIM_BIN_PATH: nvim-macos/bin
30+
EXTRACT: tar xzf
31+
- os: windows-latest
32+
NIGHTLY: nvim-win64.zip
33+
NVIM_BIN_PATH: nvim-win64/bin
34+
EXTRACT: unzip
35+
36+
runs-on: ${{ matrix.os }}
37+
38+
# Steps represent a sequence of tasks that will be executed as part of the job
39+
steps:
40+
- uses: actions/checkout@v3
41+
- uses: actions/setup-python@v4
42+
with:
43+
cache: 'pip'
44+
python-version: ${{ matrix.python }}
45+
46+
- name: install neovim
47+
run: |
48+
curl -LO 'https://github.com/neovim/neovim/releases/download/nightly/${{ matrix.NIGHTLY }}'
49+
${{ matrix.EXTRACT }} ${{ matrix.NIGHTLY }}
50+
echo '${{ runner.os }}'
51+
52+
- name: update path (bash)
53+
if: runner.os != 'Windows'
54+
run: echo "$(pwd)/${{ matrix.NVIM_BIN_PATH }}" >> $GITHUB_PATH
55+
56+
- name: update path (windows)
57+
if: runner.os == 'Windows'
58+
run: echo "$(pwd)/${{ matrix.NVIM_BIN_PATH }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
59+
60+
- name: install dependencies
61+
run: |
62+
pip install . # Install from setup.py
63+
pip install -q pytest
64+
65+
- name: test
66+
run: |
67+
echo $PATH
68+
which nvim
69+
nvim --version
70+
python -m pytest
71+
72+
- uses: codecov/codecov-action@v3
73+
if: runner.os == 'macOS'
74+
with:
75+
verbose: true # optional (default = false)
76+
77+
# TODO: tox, codecov steps from old travis workflow
78+
#
79+
# env: CI_TARGET=checkqa TOXENV=checkqa,docs
80+
# script:
81+
# - tox
82+
# after_script:
83+
# - if [ $CI_TARGET = tests ]; then
84+
# set -x;
85+
# pip install coverage;
86+
# coverage combine;
87+
# coverage report -m;
88+
# coverage xml;
89+
# bash <(curl --retry 5 --silent --fail https://codecov.io/bash) -f coverage.xml;
90+
# set +x;
91+
# fi

.travis.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
setup(name='pynvim',
3838
version='0.4.3',
39-
description='Python client to neovim',
39+
description='Python client for Neovim',
4040
url='http://github.com/neovim/pynvim',
4141
download_url='https://github.com/neovim/pynvim/archive/0.4.3.tar.gz',
4242
author='Thiago de Arruda',

test/test_host.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ def test_host_async_error(vim):
2929
assert 'rplugin-host: Async request caused an error:\nboom\n' \
3030
in h._on_error_event(None, 'boom')
3131

32+
3233
def test_legacy_vim_eval(vim):
3334
h = ScriptHost(vim)
3435
assert h.legacy_vim.eval('1') == '1'
35-
assert h.legacy_vim.eval('v:null') == None
36-
assert h.legacy_vim.eval('v:true') == True
37-
assert h.legacy_vim.eval('v:false') == False
36+
assert h.legacy_vim.eval('v:null') is None
37+
assert h.legacy_vim.eval('v:true') is True
38+
assert h.legacy_vim.eval('v:false') is False

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{27,34,35,36,37,38}-{asyncio,pyuv}-cov,pypy-cov
3+
py{310,311}-{asyncio,pyuv}-cov,pypy-cov
44
checkqa
55

66
[testenv]

0 commit comments

Comments
 (0)