Files
OpenBB/.github/workflows/codecov.yml
Colin Delahunty f794d518fd Added coverage to actions (#1526)
* Added coverage to actions

* fixed test call

* Fixed .coveragerc

* updated coverage

* Added workflow

* Switch to seperate coverage workflow

* Refactored

* Copied example perfectly

* Fixed test call

* Added dependencies

* Updated command call

* Fixed name

* Switched to codecov

* CHanged on

* Improved codecov

* Fixed run command

* Fixed codecov code
2022-03-21 14:08:28 -04:00

63 lines
1.5 KiB
YAML
Vendored

name: Codecov
env:
PIP_DEFAULT_TIMEOUT: 100
GTFF_USE_PROMPT_TOOLKIT: false
GTFF_USE_ION: false
GTFF_ENABLE_QUICK_EXIT: true
on: [pull_request, push]
jobs:
run:
name: Codecov Report
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@master
with:
python-version: 3.7
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9"
architecture: x64
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.1.11
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install Package
run: poetry install --no-interaction
- name: Generate coverage report
run: |
source $VENV
pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
verbose: true