-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (46 loc) · 1.54 KB
/
ci.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
name: CI workflow
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
on:
push:
branches: ["main"]
pull_request:
branches:
- '*'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-pip-${{ hashFiles('requirements.txt') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov pytest-mock pytest-coverage
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
pytest --cov
- name: Creating coverage folder
run: |
mkdir -p coverage
- name: Coverage Bagdge
uses: tj-actions/[email protected]
with:
output: coverage/coverage.svg
- name: Publish coverage report to coverage-badge branch
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: coverage-badge
folder: coverage