@@ -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,37 @@ 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-branch \
62+ --cov-report=xml \
63+ --cov-report=term
64+
65+ - name : Upload coverage to Codecov
66+ if : ${{ matrix.coverage == true }}
67+ uses : codecov/codecov-action@v5
68+ with :
69+ token : ${{ secrets.CODECOV_TOKEN }}
70+ files : coverage.xml
71+ flags : ${{ matrix.os }}-py${{ matrix.python-version }}
72+ name : codecov-${{ matrix.os }}-${{ matrix.python-version }}
73+ fail_ci_if_error : true
74+ verbose : true
75+
4876 - name : Run pre-commit hooks
4977 uses : pre-commit/action@v3.0.1
5078 if : ${{ matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest' }}
0 commit comments