Skip to content

Commit e4825b4

Browse files
committed
CI: Combine coverage reporting into existing test workflow
1 parent 8cd3b9c commit e4825b4

File tree

2 files changed

+47
-47
lines changed

2 files changed

+47
-47
lines changed

.github/workflows/coverage.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/pytests.yml

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,56 @@ on:
66
- main
77
pull_request:
88

9+
910
jobs:
1011
test:
12+
name: Run tests and collect coverage
1113
runs-on: ubuntu-latest
1214
steps:
13-
- uses: actions/checkout@v4
14-
- uses: gardenlinux/python-gardenlinux-lib/.github/actions/setup@main
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 2
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.13'
24+
25+
- name: Install Poetry
26+
uses: snok/install-poetry@v1
27+
28+
- name: Cache Poetry Dependencies
29+
uses: actions/cache@v4
30+
with:
31+
path: |
32+
$HOME/.cache/pypoetry
33+
$HOME/.cache/pip
34+
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
35+
restore-key: |
36+
${{ runner.os }}-poetry-
37+
38+
- name: Install dependencies
39+
run: poetry install --with dev
40+
41+
- name: Export requirements.txt for compatibility
42+
run: poetry export --without-hashes -f requirements.txt -o requirements.txt
43+
44+
- name: Setup Gardenlinux
45+
uses: gardenlinux/python-gardenlinux-lib/.github/actions/setup@main
46+
47+
- name: Prepare environment
48+
run: make install-test
49+
1550
- name: Run tests
16-
run: |
51+
run: |
1752
export GLOCI_REGISTRY_TOKEN="invalid"
18-
make test
53+
make test-coverage-ci
54+
55+
- name: Check for report
56+
run: test -f coverage.xml
57+
58+
- name: Upload results to Codecov
59+
uses: codecov/codecov-action@v5
60+
with:
61+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)