-
Notifications
You must be signed in to change notification settings - Fork 5
75 lines (72 loc) · 1.86 KB
/
python-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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Python CI/CD
permissions:
contents: write
pages: write
id-token: write
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [
#'3.5.10-slim',
#'3.6.13-slim',
'3.7.17-slim',
'3.8.18-slim',
'3.9.19-slim',
'3.10.14-slim',
'3.11.9-slim',
'3.12.3-slim',
]
container:
image: python:${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements_dev.txt
- name: Run tests and generate reports
run: |
pytest --cov=open2fa --cov-report=xml --html=report.html \
--cov-report=term-missing --cov-fail-under=70 -vv \
-s tests.py
- name: Upload reports as artifacts
if: matrix.python-version == '3.11.9-slim'
uses: actions/upload-artifact@v2
with:
name: Reports
path: |
report.html
coverage.xml
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Configure git
run: |
git config user.name 'GitHub Actions'
git config user.email '[email protected]'
- name: Checkout gh-pages
run: |
git fetch
git checkout gh-pages
git pull origin gh-pages
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: Reports
- name: Add and Push Reports
run: |
cp report.html index.html
git status
git add .
git commit -m "Add report to pages"
git push -f origin gh-pages