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 a4ef2f6
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/tests.yml
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

0 comments on commit a4ef2f6

Please sign in to comment.