Skip to content

Commit efafe02

Browse files
run coverage and parallel tests
1 parent 0826d6e commit efafe02

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

.github/workflows/test.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,42 @@ concurrency:
77
cancel-in-progress: true
88

99
jobs:
10-
1110
test:
12-
13-
name: Python ${{ matrix.python-version }} (${{ matrix.os }})
14-
runs-on: ${{ matrix.os }}
1511
strategy:
16-
max-parallel: 5
1712
matrix:
18-
os: [ubuntu-latest, macos-latest]
19-
python-version: ['3.9', '3.10', '3.11']
13+
runs-on:
14+
- ubuntu-latest
15+
- macos-latest
16+
python-version:
17+
- '3.9'
18+
- '3.10'
19+
- '3.11'
2020
fail-fast: false
21-
21+
runs-on: ${{ matrix.runs-on }}
22+
name: Python ${{ matrix.python-version }} (${{ matrix.runs-on }})
2223
steps:
2324
- uses: actions/checkout@v4
24-
2525
- uses: actions/setup-python@v5
2626
with:
2727
python-version: ${{ matrix.python-version }}
2828
cache: pip
2929
cache-dependency-path: pyproject.toml
30-
3130
- name: set useful environment variables
3231
run: |
3332
echo PYTHONVERSION=${{ matrix.python-version }} >> $GITHUB_ENV
3433
echo EXOCTK_DATA=$RUNNER_WORKSPACE/exoctk/exoctk/data/ >> $GITHUB_ENV
35-
36-
- run: pip freeze
37-
38-
- run: pip install .[test]
39-
40-
- run: pytest exoctk/tests/
41-
34+
- run: pip install .
4235
- run: pip freeze > requirements-py${{ matrix.python-version }}-${{ matrix.os }}.txt
43-
36+
- run: pip install .[test]
37+
- run: pytest exoctk/tests/ --cov ./ --cov-report term-missing --cov xml -n auto
38+
- uses: codecov/codecov-action@v4
39+
with:
40+
files: ./coverage.xml
41+
env:
42+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4443
- uses: actions/upload-artifact@v3
4544
with:
4645
path: requirements-py${{ matrix.python-version }}-${{ matrix.os }}.txt
47-
4846
- if: (github.event_name == 'release' && github.event.action == 'published')
4947
uses: svenstaro/upload-release-action@v2
5048
with:

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ dynamic = ["version"]
7070
test = [
7171
"pytest",
7272
"pytest-cov",
73+
"pytest-xdist",
7374
]
7475
docs = [
7576
"sphinx",

0 commit comments

Comments
 (0)