@@ -18,13 +18,19 @@ jobs:
18
18
os : [ubuntu-latest, macos-latest, windows-latest]
19
19
python-version : ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
20
20
21
+ include :
22
+ - os : ubuntu-latest
23
+ python-version : " 3.13"
24
+ coverage : true
25
+
21
26
steps :
22
27
- uses : actions/checkout@v4
23
28
24
29
- name : Set up Python
25
30
uses : actions/setup-python@v5
26
31
with :
27
32
python-version : ${{ matrix.python-version }}
33
+
28
34
- name : Locate pip cache
29
35
id : pip-cache
30
36
shell : bash
@@ -36,15 +42,35 @@ jobs:
36
42
path : ${{ steps.pip-cache.outputs.dir }}
37
43
key : ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
38
44
restore-keys : ${{ runner.os }}-pip-
45
+
39
46
- name : Install dependencies
40
47
run : |
41
48
python -m pip install --upgrade pip
42
49
python -m pip install ".[dev]"
43
50
44
51
- name : Run tests
52
+ if : ${{ matrix.coverage != true }}
45
53
run : pytest
46
54
47
- # Run pre-commit only on Python 3.13 + ubuntu.
55
+ - name : Run tests and collect coverage
56
+ if : ${{ matrix.coverage == true }}
57
+ run : |
58
+ pytest \
59
+ --cov=gitingest \
60
+ --cov=server \
61
+ --cov-report=xml \
62
+ --cov-report=term
63
+
64
+ - name : Upload coverage to Codecov
65
+ if : ${{ matrix.coverage == true }}
66
+ uses : codecov/codecov-action@v5
67
+ with :
68
+ files : coverage.xml
69
+ flags : ${{ matrix.os }}-py${{ matrix.python-version }}
70
+ name : codecov-${{ matrix.os }}-${{ matrix.python-version }}
71
+ fail_ci_if_error : true
72
+ verbose : true
73
+
48
74
- name : Run pre-commit hooks
49
75
uses :
pre-commit/[email protected]
50
76
if : ${{ matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest' }}
0 commit comments