-
Notifications
You must be signed in to change notification settings - Fork 50
54 lines (45 loc) · 1.38 KB
/
ci.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
# This configuration does the following:
# It triggers the CI pipeline when code is pushed to the master branch.
# It sets up a Python environment, installs project dependencies, and runs pytest.
# Test results are uploaded as artifacts for later examination.
name: CI
on:
push:
branches:
# - master
- 147_CI-pipeline
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.10.13
- name: Install Dependencies
run: |
pip install -r requirements.txt
pip install pytest pytest-html pytest-cov
- name: Run Tests with coverage and save report
run: |
coverage run -m pytest pytest/
coverage xml -o coverage.xml
pytest pytest/ --junitxml=report.xml --html=report.html
continue-on-error: true # Continue to the next step even if tests fail
- name: Upload HTML Report
uses: actions/upload-artifact@v2
with:
name: test-report-html
path: report.html
- name: Upload XML Report
uses: actions/upload-artifact@v2
with:
name: test-report-xml
path: report.xml
- name: Upload Coverage Report
uses: actions/upload-artifact@v2
with:
name: coverage-report
path: coverage.xml