-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (53 loc) · 1.56 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Run Python UnitTests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
steps:
- name: Checkout Repo Code
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r src/abbfreeathome/dev-requirements.txt
- name: Install abbfreeathome Python Package
run: |
pip install .
- name: Test with pytest
run: |
pytest \
--cov=. \
--cov-report=xml:coverage/coverage.xml \
--junitxml=junit/test-results.xml
- name: Code Coverage Summary Report
id: coverage
uses: irongut/[email protected]
with:
filename: coverage/coverage.xml
badge: true
format: markdown
output: both
fail_below_min: true
thresholds: '100 100'
- name: Write Coverage to Job Summary
if: success() || steps.coverage.conclusion == 'failure'
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
- name: Publish Test Report
uses: mikepenz/[email protected]
if: success() || failure()
with:
report_paths: junit/test-results.xml
detailed_summary: true
comment: false