Skip to content

Commit

Permalink
Try fixing up caching issue
Browse files Browse the repository at this point in the history
  • Loading branch information
znicholls committed Jan 19, 2024
1 parent f7efaa4 commit 4d965e9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
21 changes: 13 additions & 8 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,30 @@ runs:
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
cache: poetry
- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ~/.local # the path depends on the OS
key: "${{ inputs.os }}-poetry-5" # increment to reset cache
key: "${{ inputs.os }}-${{ inputs.python-version }}-poetry-1" # increment to reset cache
- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
if: ${{ inputs.run-poetry-install == 'true' }}
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: ~/.cache
key: "venv-${{ inputs.venv-id }}-${{ inputs.os }}-${{ inputs.python-version }}-${{ hashFiles('**/poetry.lock') }}"
# Maybe delete this
- name: Set Poetry environment
run: |
poetry env use ${{ inputs.python-version }}
# - name: Load cached venv
# if: ${{ inputs.run-poetry-install == 'true' }}
# id: cached-poetry-dependencies
# uses: actions/cache@v3
# with:
# path: ~/.cache
# key: "venv-${{ inputs.venv-id }}-${{ inputs.os }}-${{ inputs.python-version }}-${{ hashFiles('**/poetry.lock') }}"
# Install dependencies first so that our package doesn't appear in the cache by accident
- name: Install dependencies
if: ${{ inputs.run-poetry-install == 'true' }}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
python-version: [ "3.9", "3.10", "3.11" ]
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
include:
- VENV: .venv/bin/activate
- os: windows-latest
VENV: .venv/scripts/activate
runs-on: "${{ matrix.os }}"
defaults:
run:
Expand Down

0 comments on commit 4d965e9

Please sign in to comment.