Skip to content

Commit 5822cc0

Browse files
committed
ci: update GH workflow (coverage fix)
- Changed the runner environment from ubuntu-24.04 to ubuntu-latest for both tests and coverage jobs. - Simplified the tox command to directly specify the environment. - Adjusted the coverage data upload path to include the Python version.
1 parent 6eb9bf0 commit 5822cc0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
tests:
1212
name: Python ${{ matrix.python-version }}
13-
runs-on: ubuntu-24.04
13+
runs-on: ubuntu-latest
1414

1515
strategy:
1616
fail-fast: false
@@ -28,7 +28,6 @@ jobs:
2828
- uses: actions/setup-python@v6
2929
with:
3030
python-version: ${{ matrix.python-version }}
31-
allow-prereleases: true
3231

3332
- name: Install dependencies
3433
run: |
@@ -39,19 +38,21 @@ jobs:
3938
4039
- name: Run tox targets for ${{ matrix.python-version }}
4140
run: |
42-
ENV_PREFIX=$(tr -C -d "0-9" <<< "${{ matrix.python-version }}")
43-
TOXENV=$(tox --listenvs | grep "^py$ENV_PREFIX" | tr '\n' ',') tox
41+
tox -e py${{ matrix.python-version }}
42+
env:
43+
# Set the COVERAGE_FILE environment variable for coverage.py
44+
COVERAGE_FILE: .coverage.${{ matrix.python-version }}
4445

4546
- name: Upload coverage data
4647
if: always()
4748
uses: actions/upload-artifact@v6
4849
with:
4950
name: coverage-data-${{ matrix.python-version }}
50-
path: '.coverage.*'
51+
path: .coverage.${{ matrix.python-version }}
5152

5253
coverage:
5354
name: Coverage
54-
runs-on: ubuntu-24.04
55+
runs-on: ubuntu-latest
5556
needs: tests
5657
steps:
5758
- uses: actions/checkout@v5
@@ -76,7 +77,6 @@ jobs:
7677
python -m coverage report --fail-under=55
7778
7879
- name: Upload HTML report
79-
if: ${{ failure() }}
8080
uses: actions/upload-artifact@v6
8181
with:
8282
name: html-report

0 commit comments

Comments
 (0)