-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (48 loc) · 1.55 KB
/
update_coverage_report.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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Update Coverage Report
on:
push:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
update_coverage_report:
permissions:
pages: write
id-token: write
runs-on: [ubuntu-latest]
environment: Dev
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-responses coverage genbadge defusedxml
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e .
- name: Test with pytest
run: |
coverage run -m pytest
- name: Build Coverage Report
run: |
coverage html -d ./htmlcov
- name: Generate Coverage Badge
run: |
coverage xml
genbadge coverage -i ./coverage.xml -o ./htmlcov/coveragecoverage-badge.svg
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './htmlcov'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4