-
Notifications
You must be signed in to change notification settings - Fork 2
112 lines (108 loc) · 3.22 KB
/
tests.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: tests
on:
pull_request:
push:
branches:
- "main"
jobs:
# Test all other supported Python version
testing-py3xx:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run pytest with coverage
continue-on-error: true
run: |
tox -e test -- --junitxml=results.xml tests/
- name: Test report
uses: mikepenz/action-junit-report@v4
if: always()
with:
check_name: Test Report (${{ matrix.os }}, ${{ matrix.python }})
report_paths: "**/results.xml"
detailed_summary: true
# Testing with Python 3.11 and coverage file artifacts
testing:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ["3.11"]
tests: ["", "-msgpack", "-jit"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run pytest with coverage
continue-on-error: true
run: |
tox -e test${{ matrix.tests }} -- --junitxml=results.xml tests/
- name: Test report
uses: mikepenz/action-junit-report@v4
if: always()
with:
check_name: Test Report (${{ matrix.os }}, ${{ matrix.python }}, ${{ matrix.tests }})
report_paths: "**/results.xml"
detailed_summary: true
- name: Upload coverage
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-${{ matrix.python }}-${{ matrix.os }}${{ matrix.tests }}
path: "${{ github.workspace }}/.coverage*"
retention-days: 1
# Collectiong and combining all coverage files
coverage:
needs: [testing]
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Download coverage for testing
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Convert coverage
run: |
tox -e coverage
- name: Code Coverage Report
uses: irongut/[email protected]
with:
filename: "**/coverage.xml"
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '50 75'