-
Notifications
You must be signed in to change notification settings - Fork 25
62 lines (57 loc) · 2.06 KB
/
ci.yml
File metadata and controls
62 lines (57 loc) · 2.06 KB
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "pypy3.7", "pypy3.8", "pypy3.9"]
pytest-version: ["7.1.0", "6.0.0", "5.1.0"]
include:
- python-version: "3.10"
pytest-version: "7.1.0"
- python-version: "3.11"
pytest-version: "7.1.0"
- python-version: "3.8"
pytest-version: "7.2.0"
- python-version: "3.12"
pytest-version: "7.2.0"
- python-version: "3.8"
pytest-version: "8.0.1"
- python-version: "3.12"
pytest-version: "8.0.1"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest==${{ matrix.pytest-version }} pytest-cov
python -m pip install -e .[dev]
- name: Test with pytest
run: |
COV_CORE_SOURCE=pytest_nunit COV_CORE_CONFIG=.coveragerc COV_CORE_DATAFILE=.coverage.eager pytest --cov=pytest_nunit --cov-append
coverage report -m
coverage xml -o coverage.xml
- name: pytest with nunit-xml flag - passes
run: |
python -m pytest tests/unit -v --nunit-xml=test-results-unit.xml
- name: pytest with xdist
run: |
python -m pip install pytest-xdist
python -m pytest tests/unit -v --nunit-xml=test-results-xdist.xml -n 2
grep "test-suite" test-results-xdist.xml | true
- uses: codecov/codecov-action@v3
with:
verbose: true
files: ./coverage.xml