@@ -18,13 +18,19 @@ jobs:
1818 os : [ubuntu-latest, macos-latest, windows-latest]
1919 python-version : ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
2020
21+ include :
22+ - os : ubuntu-latest
23+ python-version : " 3.13"
24+ coverage : true
25+
2126 steps :
2227 - uses : actions/checkout@v4
2328
2429 - name : Set up Python
2530 uses : actions/setup-python@v5
2631 with :
2732 python-version : ${{ matrix.python-version }}
33+
2834 - name : Locate pip cache
2935 id : pip-cache
3036 shell : bash
@@ -36,15 +42,35 @@ jobs:
3642 path : ${{ steps.pip-cache.outputs.dir }}
3743 key : ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
3844 restore-keys : ${{ runner.os }}-pip-
45+
3946 - name : Install dependencies
4047 run : |
4148 python -m pip install --upgrade pip
4249 python -m pip install ".[dev]"
4350
4451 - name : Run tests
52+ if : ${{ matrix.coverage != true }}
4553 run : pytest
4654
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+
4874 - name : Run pre-commit hooks
4975 uses : pre-commit/action@v3.0.1
5076 if : ${{ matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest' }}
0 commit comments