Skip to content

Commit a700350

Browse files
committed
ci: adds a github workflow for experimental purposes
1 parent 5805066 commit a700350

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/unittest.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- main
5+
name: unittest
6+
jobs:
7+
unit:
8+
# Use `ubuntu-latest` runner.
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
- name: Setup Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ matrix.python }}
20+
- name: Install nox
21+
run: |
22+
python -m pip install --upgrade setuptools pip wheel
23+
python -m pip install nox
24+
- name: Run unit tests
25+
env:
26+
COVERAGE_FILE: .coverage-${{ matrix.python }}
27+
run: |
28+
nox -s unit-${{ matrix.python }}
29+
- name: Upload coverage results
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: coverage-artifact-${{ matrix.python }}
33+
path: .coverage-${{ matrix.python }}
34+
include-hidden-files: true
35+
36+
cover:
37+
runs-on: ubuntu-latest
38+
needs:
39+
- unit
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v4
43+
- name: Setup Python
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: "3.9"
47+
- name: Install coverage
48+
run: |
49+
python -m pip install --upgrade setuptools pip wheel
50+
python -m pip install coverage
51+
- name: Download coverage results
52+
uses: actions/download-artifact@v4
53+
with:
54+
path: .coverage-results/
55+
- name: Report coverage results
56+
run: |
57+
find .coverage-results -type f -name '*.zip' -exec unzip {} \;
58+
coverage combine .coverage-results/**/.coverage*
59+
coverage report --show-missing --fail-under=100

0 commit comments

Comments
 (0)