Skip to content

Commit 27a8e80

Browse files
committed
evaluate coverage badge generation
1 parent 2a3d383 commit 27a8e80

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.github/workflows/coverage.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Thingpress Unit Test Code Coverage
2+
run-name: ${{ github.actor }} invoking coverage
3+
on: [push]
4+
jobs:
5+
Coverage:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- uses: actions/setup-python@v4
10+
with:
11+
python-version: 3.13
12+
- name: 'Install dependencies'
13+
run: |
14+
pip install -r ./requirements.txt
15+
- name: 'Run coverage'
16+
run: |
17+
coverage run --source=src/bulk_importer,src/product_provider,src/provider_espressif,src/provider_infineon,src/provider_microchip -m pytest
18+
coverage report -m
19+
- name: Coverage Badge
20+
uses: tj-actions/coverage-badge-py@v2
21+
- name: Verify Changed files
22+
uses: tj-actions/verify-changed-files@v16
23+
id: verify-changed-files
24+
with:
25+
files: coverage.svg
26+
- name: 'Commit files'
27+
if: steps.verify-changed-files.outputs.files_changed == 'true'
28+
run: |
29+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
30+
git config --local user.name "github-actions[bot]"
31+
git add coverage.svg
32+
git commit -m "Updated coverage.svg"
33+
34+
- name: 'Push changes'
35+
if: steps.verify-changed-files.outputs.files_changed == 'true'
36+
uses: ad-m/github-push-action@master
37+
with:
38+
github_token: ${{ secrets.github_token }}
39+
branch: ${{ github.ref }}

requirements.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
aws_lambda_powertools==3.12.0
2+
botocore==1.38.15
3+
boto3==1.38.15
4+
coverage==7.8.0
5+
coverage-badge==1.1.2
6+
cryptography==44.0.3
7+
moto==5.1.4
8+
pylint==3.3.7
9+
pytest==8.3.5
10+
pytest-socket==0.7.0
11+
pyYAML==6.0.2

0 commit comments

Comments
 (0)