Skip to content

Commit 05a195b

Browse files
jamessanjustinmk
authored andcommitted
ci: use tox in GitHub Actions
1 parent 3c5d91a commit 05a195b

File tree

2 files changed

+36
-11
lines changed

2 files changed

+36
-11
lines changed

.github/workflows/test.yml

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: test
1+
name: ci
22
on:
33
push:
44
pull_request:
@@ -10,9 +10,24 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
env:
13-
PYTEST_ADDOPTS: '-vv'
13+
PYTEST_ADDOPTS: '-vv --cov-append'
1414

1515
jobs:
16+
lint:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- uses: actions/setup-python@v4
21+
with:
22+
cache: 'pip'
23+
python-version: 3.11
24+
- name: install dependencies
25+
run: pip install tox tox-gh-actions
26+
- name: checkqa
27+
env:
28+
TOXENV: 'checkqa,docs'
29+
run: tox
30+
1631
test:
1732
strategy:
1833
fail-fast: false
@@ -34,8 +49,6 @@ jobs:
3449
EXTRACT: unzip
3550

3651
runs-on: ${{ matrix.os }}
37-
38-
# Steps represent a sequence of tasks that will be executed as part of the job
3952
steps:
4053
- uses: actions/checkout@v3
4154
- uses: actions/setup-python@v4
@@ -58,21 +71,27 @@ jobs:
5871
run: echo "$(pwd)/${{ matrix.NVIM_BIN_PATH }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
5972

6073
- name: install dependencies
61-
run: |
62-
pip install . # Install from setup.py
63-
pip install -q pytest
74+
run: pip install tox tox-gh-actions
6475

6576
- name: test
6677
run: |
6778
echo $PATH
6879
which nvim
6980
nvim --version
70-
python -m pytest
81+
tox
82+
83+
- if: matrix.target == 'tests'
84+
name: Run coverage report
85+
run: |
86+
pip install coverage
87+
coverage report -m
88+
coverage xml
7189
72-
- uses: codecov/codecov-action@v3
73-
if: runner.os == 'macOS'
90+
- if: matrix.target == 'tests'
91+
uses: codecov/codecov-action@v3
7492
with:
75-
verbose: true # optional (default = false)
93+
file: coverage.xml
94+
verbose: true
7695

7796
# TODO: tox, codecov steps from old travis workflow
7897
#

tox.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ envlist =
33
py{310,311}-{asyncio,pyuv}-cov,pypy-cov
44
checkqa
55

6+
[gh-actions]
7+
python =
8+
3.10: py310
9+
3.11: py311
10+
pypy3: pypy3
11+
612
[testenv]
713
extras = test
814
deps =

0 commit comments

Comments
 (0)