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 13ac2b2
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
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
- 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

0 comments on commit 13ac2b2

Please sign in to comment.