-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (60 loc) · 2.1 KB
/
master_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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: "Master_Coverage"
on:
# As currently structured, this adds too many jobs (checks?), so don't run it
# on pull requests yet.
push:
branches:
- master
pull_request:
branches:
- master
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
jobs:
coverage:
name: "Python 3.9 on Ubuntu"
#container: python:3.9
runs-on: ubuntu-latest
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
- name: "Set up Python"
uses: "actions/setup-python@v3"
with:
python-version: 3.9
cache: pip
#cache-dependency-path: "residual_term_builder/.cache/pip"
- name: "Install dependencies"
run: |
python -V # Print out python version for debugging
python -m pip install virtualenv >> setup_output.txt
virtualenv venv >> setup_output.txt
. venv/bin/activate
python -m pip install -r requirements.txt >> setup_output.txt
python -m pip install -r test_requirements.txt >> setup_output.txt
- name: "Generate coverage report"
run: |
. venv/bin/activate
python -m coverage run -m pytest -k 'deep' >> printing_output.txt # only run deep tests (1 ~ 3 seconds long)
python -m coverage html
python -m coverage xml
python -m coverage report
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
directory: ./
fail_ci_if_error: true # optional (default = false)
files: coverage*.xml
#flags: unittests # optional
name: codecov-umbrella # optional
verbose: true # optional (default = false)
- name: "Store testing data and coverage report as artifacts"
uses: actions/upload-artifact@v3
with:
name: htmlcov
path: |
htmlcov/*
setup_output.txt
default_logging_file.txt
printing_output.txt