-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (35 loc) · 1 KB
/
Test_coverage.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
name: Check coverage
on:
pull_request:
branches:
- production
- main
push:
branches:
- production
- main
jobs:
compare-coverage:
name: Compare with previous coverage
runs-on: ubuntu-latest
steps:
- name: Setup git
uses: actions/checkout@v3
- name: Get the git branch
uses: actions/checkout@v3
with:
ref: main # TODO: dynamically get the branch against which the PR will be merged?
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r web/requirements.app.txt
pip install -r web/requirements.dev.txt
pip install diff-cover
- name: Run unit tests with coverage
run: pytest --cov --cov-report=xml
- name: Check that the edited lines are all covered
run: diff-cover coverage.xml --fail-under=100