Skip to content

Commit

Permalink
Update test action to use https://github.com/snok/install-poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
atwalsh committed Dec 28, 2020
1 parent 0ae6b9b commit e814099
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Tests

on: [push, pull_request]
on: [ push, pull_request ]

env:
POETRY_VIRTUALENVS_IN_PROJECT: "true"
Expand All @@ -9,26 +9,28 @@ 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: actions/cache@v2
uses: snok/[email protected]
with:
path: .venv
key: ${{ hashFiles('poetry.lock') }}
virtualenvs-in-project: true
run: poetry --version
- 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
run: poetry install --no-root
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Test with pytest
run: poetry run pytest

0 comments on commit e814099

Please sign in to comment.