forked from CoinFabrik/geppetto
-
Notifications
You must be signed in to change notification settings - Fork 15
58 lines (46 loc) · 1.53 KB
/
tests-python.yml
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
name: Geppetto Tests
on:
push:
branches:
- main
- develop
jobs:
Test-Python3:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Run Python
run: python --version
- name: Cache Python dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: install requirements
run: |
pip install -r requirements.txt
python --version
- name: Run Test
run: |
python -m xmlrunner discover tests -v -o test_reports
pytest -v --cov=./ tests/ --cov-report=html
- name: Publish Test Results
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: 'test_reports/*.xml'
detailed_summary: true
include_passed: true
- name: Archive Test Reports
uses: actions/upload-artifact@v4 # Uploads artifacts (test reports) for access from the GitHub UI
if: always() # This step will also run regardless of the success or failure of previous steps
with:
name: test-reports # Name of the artifact
path: htmlcov/*.html # Path to the test reports to be archived
compression-level: 0 # no compression