Skip to content

Commit

Permalink
github: enforce cache health
Browse files Browse the repository at this point in the history
  • Loading branch information
abn committed Apr 10, 2020
1 parent dd0e09f commit 7c0a2dd
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,16 @@ jobs:
source $HOME/.poetry/env
poetry config virtualenvs.in-project true
- name: Set up cache
id: cache
uses: actions/cache@v1
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: |
source $HOME/.poetry/env
poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- name: Install dependencies
run: |
source $HOME/.poetry/env
Expand Down Expand Up @@ -76,10 +82,16 @@ jobs:
source $HOME/.poetry/env
poetry config virtualenvs.in-project true
- name: Set up cache
id: cache
uses: actions/cache@v1
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: |
source $HOME/.poetry/env
poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- name: Install dependencies
run: |
source $HOME/.poetry/env
Expand Down Expand Up @@ -113,10 +125,17 @@ jobs:
$env:Path += ";$env:Userprofile\.poetry\bin"
poetry config virtualenvs.in-project true
- name: Set up cache
id: cache
uses: actions/cache@v1
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
shell: bash
run: |
source $(cmd.exe /C echo %USERPROFILE%)/.poetry/env
poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- name: Install dependencies
run: |
$env:Path += ";$env:Userprofile\.poetry\bin"
Expand Down

0 comments on commit 7c0a2dd

Please sign in to comment.