Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jrm5100 committed Jul 15, 2021
1 parent 31b9b31 commit f9e71ca
Showing 1 changed file with 30 additions and 20 deletions.
50 changes: 30 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,42 @@ jobs:
run: sudo apt-get install libcurl4-openssl-dev

- name: Install Poetry
uses: snok/[email protected]
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Cache Poetry virtualenv
uses: actions/cache@v1
id: cache
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: ~/.virtualenvs
key: poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ hashFiles('**/poetry.lock') }}
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Set Poetry config
run: |
poetry config virtualenvs.in-project false
poetry config virtualenvs.path ~/.virtualenvs
- name: Install Dependencies
run: |
poetry install
if: steps.cache.outputs.cache-hit != 'true'
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction

- name: Code Quality
run: poetry run black . --check
run: |
source .venv/bin/activate
black . --check
- name: Test with pytest
run: poetry run pytest -n 2 --cov . --cov-report=xml
run: |
source .venv/bin/activate
pytest -n 2 --cov . --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
Expand All @@ -63,4 +73,4 @@ jobs:
name: codecov-umbrella
fail_ci_if_error: true
path_to_write_report: ./codecov_report.gz
verbose: true
verbose: true

0 comments on commit f9e71ca

Please sign in to comment.