Skip to content

Commit

Permalink
Fix windows env caching in GH
Browse files Browse the repository at this point in the history
  • Loading branch information
gutzbenj committed Jan 23, 2021
1 parent 2cbae78 commit 3d6e992
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
32 changes: 22 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,44 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.6", "3.7", "3.8", "3.9"]
defaults:
run:
shell: bash
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
name: Python ${{ matrix.python-version }} on OS ${{ matrix.os }}
steps:
- name: Acquire sources
uses: actions/checkout@v2
uses: actions/[email protected]

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Setup Poetry
uses: Gr1N/setup-poetry@v4
- name: Configure poetry
# FROM https://github.com/northtree/poetry-github-actions/actions/runs/170795796/workflow
run: |
poetry config virtualenvs.in-project false
poetry config cache-dir ~/.poetry
poetry config virtualenvs.path ~/.poetry/venv

- name: Install and configure Poetry
uses: snok/install-poetry@v1.1.1
with:
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv

- name: Load cached dependencies
uses: actions/cache@v2
id: cache
with:
path: ~/.poetry
path: .venv
key: ${{ matrix.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: timeout 10s poetry run pip --version || rm -rf .venv

- name: Install library
if: steps.cache.output.cache-hit != 'true'
run: poetry install --extras=http --extras=sql --extras=excel

- name: Test
run: poetry run poe test
12 changes: 6 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3d6e992

Please sign in to comment.