-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
20 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -63,4 +73,4 @@ jobs: | |
name: codecov-umbrella | ||
fail_ci_if_error: true | ||
path_to_write_report: ./codecov_report.gz | ||
verbose: true | ||
verbose: true |