-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update test action to use https://github.com/snok/install-poetry
- Loading branch information
Showing
1 changed file
with
12 additions
and
13 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 |
---|---|---|
@@ -1,34 +1,33 @@ | ||
name: Tests | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
POETRY_VIRTUALENVS_IN_PROJECT: "true" | ||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
python-version: [ 3.6, 3.7, 3.8, 3.9 ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.6 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Poetry | ||
run: | | ||
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python | ||
echo "::add-path::$HOME/.poetry/bin" | ||
source $HOME/.poetry/env | ||
poetry --version | ||
- name: Cache dependencies | ||
uses: snok/[email protected] | ||
with: | ||
virtualenvs-in-project: true | ||
run: poetry --version | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: ${{ hashFiles('poetry.lock') }} | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
- name: Install dependencies | ||
run: poetry install --no-root | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
- name: Test with pytest | ||
run: poetry run pytest |