Skip to content

Commit b7217ba

Browse files
authored
fix(ci): Fix coverage.yml - correct name field, upgrade checkout@v4, add permissions
1 parent 9bc40c6 commit b7217ba

1 file changed

Lines changed: 19 additions & 10 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
coverage.ymlname: Code Coverage
1+
name: Code Coverage
2+
3+
permissions:
4+
contents: read
5+
checks: write
26

37
on:
48
pull_request:
@@ -10,20 +14,25 @@ jobs:
1014
coverage:
1115
runs-on: ubuntu-latest
1216
steps:
13-
- uses: actions/checkout@v3
14-
17+
- uses: actions/checkout@v4
18+
1519
- uses: actions/setup-python@v4
1620
with:
1721
python-version: '3.11'
18-
22+
1923
- name: Install dependencies
2024
run: |
25+
python -m pip install --upgrade pip
2126
pip install pytest pytest-cov
22-
pip install -r requirements.txt 2>/dev/null || true
23-
24-
- name: Run tests with coverage
27+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
28+
29+
- name: Run coverage
2530
run: |
26-
pytest tests/ --cov=. --cov-report=xml --cov-report=term || true
27-
31+
pytest --cov=. --cov-report=xml --cov-report=term-missing || true
32+
2833
- name: Upload coverage report
29-
run: echo "Coverage report generated - check Actions artifacts"
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: coverage-report
37+
path: coverage.xml
38+
if-no-files-found: warn

0 commit comments

Comments
 (0)