Skip to content
This repository was archived by the owner on Apr 13, 2026. It is now read-only.

Commit e98f95a

Browse files
committed
feat: Refactor CI workflows for improved coverage reporting
- Remove coverage reporting steps from `ci.yml` and create a new `coverage.yml` workflow for dedicated test and coverage collection. - The new workflow includes steps for setting up Python, installing dependencies, running tests with coverage, and uploading results to Codecov. Tested the new coverage workflow, and it successfully runs tests and uploads coverage reports without issues.
1 parent 16be1be commit e98f95a

2 files changed

Lines changed: 46 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,3 @@ jobs:
4747
- name: Run CI checks
4848
run: |
4949
just ci-check
50-
51-
- name: Generate coverage report
52-
run: |
53-
# Ensure coverage.xml is generated for Codecov
54-
uv run pytest --cov=. --cov-report=xml --cov-report=term-missing || echo "No tests found or pytest failed"
55-
56-
- name: Upload coverage reports to Codecov
57-
uses: codecov/codecov-action@v5
58-
with:
59-
token: ${{ secrets.CODECOV_TOKEN }}
60-
slug: EvilBit-Labs/OPNsense-config-faker

.github/workflows/coverage.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Run tests and upload coverage
2+
3+
on:
4+
push
5+
6+
jobs:
7+
test:
8+
name: Run tests and collect coverage
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 2
15+
16+
- name: Setup Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.13'
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v2
23+
with:
24+
version: latest
25+
26+
- name: Install just
27+
uses: taiki-e/install-action@just
28+
29+
- name: Cache dependencies
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
.uv/cache
34+
.pytest_cache
35+
key: ${{ runner.os }}-uv-${{ hashFiles('**/pyproject.toml') }}
36+
restore-keys: |
37+
${{ runner.os }}-uv-
38+
39+
- name: Run tests
40+
run: pytest --cov --cov-branch --cov-report=xml
41+
42+
- name: Upload results to Codecov
43+
uses: codecov/codecov-action@v5
44+
with:
45+
token: ${{ secrets.CODECOV_TOKEN }}
46+
slug: EvilBit-Labs/OPNsense-config-faker

0 commit comments

Comments
 (0)