Skip to content

Commit 19127b2

Browse files
authored
Merge #526 ci: run tests on GitHub Actions
2 parents dd540b0 + 8a2a3b8 commit 19127b2

File tree

7 files changed

+109
-68
lines changed

7 files changed

+109
-68
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+
pip3 install . # Install from setup.py
63+
pip3 install -q pytest
64+
65+
- name: test
66+
run: |
67+
echo $PATH
68+
which nvim
69+
nvim --version
70+
python3 -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+
# pip3 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.

README.md

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
Pynvim: Python client to [Neovim](https://github.com/neovim/neovim)
22
===================================================================
33

4-
[![Build Status](https://travis-ci.org/neovim/pynvim.svg?branch=master)](https://travis-ci.org/neovim/pynvim)
54
[![Documentation Status](https://readthedocs.org/projects/pynvim/badge/?version=latest)](https://pynvim.readthedocs.io/en/latest/?badge=latest)
65
[![Code coverage](https://codecov.io/gh/neovim/pynvim/branch/master/graph/badge.svg)](https://codecov.io/gh/neovim/pynvim)
76

@@ -11,29 +10,19 @@ connecting to and scripting Nvim processes through its msgpack-rpc API.
1110
Install
1211
-------
1312

14-
Supports python 2.7, and 3.4 or later.
13+
Supports python 3.10 or later.
1514

16-
```sh
17-
pip2 install pynvim
18-
pip3 install pynvim
19-
```
20-
21-
If you only use one of python2 or python3, it is enough to install that
22-
version. You can install the package without being root by adding the `--user`
23-
flag.
15+
pip3 install pynvim
2416

17+
You can install the package without being root by adding the `--user` flag.
2518
Anytime you upgrade Neovim, make sure to upgrade pynvim as well:
26-
```sh
27-
pip2 install --upgrade pynvim
28-
pip3 install --upgrade pynvim
29-
```
3019

31-
Alternatively, the master version could be installed by executing the following
32-
in the root of this repository:
33-
```sh
34-
pip2 install .
35-
pip3 install .
36-
```
20+
pip3 install --upgrade pynvim
21+
22+
Alternatively, you can install the development version by cloning this
23+
repository and executing the following at the top level:
24+
25+
pip3 install .
3726

3827
Python Plugin API
3928
-----------------
@@ -61,8 +50,8 @@ Development
6150

6251
Use (and activate) a local virtualenv.
6352

64-
python3 -m venv env36
65-
source env36/bin/activate
53+
python3 -m virtualenv venv
54+
source venv/bin/activate
6655

6756
If you change the code, you must reinstall for the changes to take effect:
6857

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_buffer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def test_options(vim):
107107
vim.current.buffer.options['define'] = 'test'
108108
assert vim.current.buffer.options['define'] == 'test'
109109
# Doesn't change the global value
110-
assert vim.options['define'] == r'^\s*#\s*define'
110+
assert vim.options['define'] == ''
111111

112112
with pytest.raises(KeyError) as excinfo:
113113
vim.current.buffer.options['doesnotexist']

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)