forked from numirias/semshi
-
Notifications
You must be signed in to change notification settings - Fork 5
86 lines (70 loc) · 2.3 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
name: "Run Tests"
on: [push, pull_request, workflow_dispatch]
jobs:
unit-tests:
name: "Unit Tests"
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
include:
- python-version: "3.7"
os: ubuntu-22.04
- python-version: "3.8"
os: ubuntu-latest
- python-version: "3.9"
os: ubuntu-latest
- python-version: "3.10"
os: ubuntu-latest
- python-version: "3.11"
os: ubuntu-latest
- python-version: "3.12-dev"
os: ubuntu-latest
neovim-version: nightly
PYNVIM_MASTER: true
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: |
python -m pip install -U pip
- name: Configure environments
run: |
python --version
- name: Enforce code style
run: |
pip install yapf isort
yapf --recursive --diff semshi/ test/
isort --check-only --diff semshi/ test/
if: ${{ matrix.python-version == '3.11' }}
- name: Setup neovim
run: |
sudo apt install libfuse2
NVIM_VERSION="${{ matrix.neovim-version }}"
if [ -z "$NVIM_VERSION" ]; then
NVIM_VERSION="stable"
fi
NVIM_DOWNLOAD_URL="https://github.com/neovim/neovim/releases/download/${NVIM_VERSION}/nvim.appimage"
mkdir -p $HOME/.local/bin
wget -O $HOME/.local/bin/nvim $NVIM_DOWNLOAD_URL
chmod +x $HOME/.local/bin/nvim
if [ -n "${{ matrix.PYNVIM_MASTER }}" ]; then
pip install 'pynvim @ git+https://github.com/neovim/pynvim.git'
else
pip install pynvim
fi
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Check neovim version
run: |
nvim --version
- name: Install dependencies
run: |
pip install pytest codecov pytest-cov
- name: Run tests
run: |
pytest -v --cov semshi/ --cov-report term-missing:skip-covered --ignore test/test_fuzz.py test/
- name: Test coverage
run: codecov