Skip to content

Commit 0e702dd

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

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

.github/workflows/test.yml

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,52 @@
11
name: test
22

3-
on: [pull_request]
3+
on:
4+
pull_request:
5+
release:
6+
types:
7+
- created
48

59
concurrency:
610
group: ${{ github.workflow }}-${{ github.ref }}
711
cancel-in-progress: true
812

913
jobs:
10-
1114
test:
12-
13-
name: Python ${{ matrix.python-version }} (${{ matrix.os }})
14-
runs-on: ${{ matrix.os }}
1515
strategy:
16-
max-parallel: 5
1716
matrix:
18-
os: [ubuntu-latest, macos-latest]
19-
python-version: ['3.9', '3.10', '3.11']
17+
runs-on:
18+
- ubuntu-latest
19+
- macos-latest
20+
python-version:
21+
- '3.9'
22+
- '3.10'
23+
- '3.11'
2024
fail-fast: false
21-
25+
runs-on: ${{ matrix.runs-on }}
26+
name: Python ${{ matrix.python-version }} (${{ matrix.runs-on }})
2227
steps:
2328
- uses: actions/checkout@v4
24-
2529
- uses: actions/setup-python@v5
2630
with:
2731
python-version: ${{ matrix.python-version }}
2832
cache: pip
2933
cache-dependency-path: pyproject.toml
30-
3134
- name: set useful environment variables
3235
run: |
3336
echo PYTHONVERSION=${{ matrix.python-version }} >> $GITHUB_ENV
3437
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-
38+
- run: pip install .
4239
- run: pip freeze > requirements-py${{ matrix.python-version }}-${{ matrix.os }}.txt
43-
40+
- run: pip install .[test]
41+
- run: pytest exoctk/tests/ --cov ./ --cov-report term-missing --cov xml -n auto
42+
- uses: codecov/codecov-action@v4
43+
with:
44+
files: ./coverage.xml
45+
env:
46+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4447
- uses: actions/upload-artifact@v3
4548
with:
4649
path: requirements-py${{ matrix.python-version }}-${{ matrix.os }}.txt
47-
4850
- if: (github.event_name == 'release' && github.event.action == 'published')
4951
uses: svenstaro/upload-release-action@v2
5052
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)