Update README.md #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |