Skip to content

Commit

Permalink
Use poetry cache workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
tnunamak committed Apr 2, 2024
1 parent 2d45966 commit 6dafbf0
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions .github/actions/build-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,27 +84,29 @@ runs:
echo "$HOME/.local/bin" >> $GITHUB_PATH
shell: bash

# Don't cache until we can avoid collisions between arm64 and x64 caches
# Handle Poetry caching manually, based on the following workaround, until caches are keyed by architecture.
# https://github.com/actions/setup-python/issues/826#issuecomment-2021999109
- name: Set up Python
if: ${{ env.RUNNER_ARCH }} != 'arm64'
uses: actions/setup-python@v5
id: setup-python
with:
python-version: '3.11'
architecture: ${{ env.RUNNER_ARCH }}

- name: Set up Python
if: ${{ env.RUNNER_ARCH }} == 'arm64'
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: poetry
cache-dependency-path: poetry.lock
architecture: ${{ env.RUNNER_ARCH }}

- name: Install dependencies with Poetry
run: poetry install --no-dev
run: |
poetry install --no-dev
echo "POETRY_CACHE_DIR=$(poetry config cache-dir)" >> $GITHUB_ENV
shell: bash

- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: ${{ env.POETRY_CACHE_DIR }}
key: ${{ runner.os }}-poetry-${{ steps.setup-python.outputs.python-version }}-${{ env.RUNNER_ARCH }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-${{ steps.setup-python.outputs.python-version }}-${{ env.RUNNER_ARCH }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand Down

0 comments on commit 6dafbf0

Please sign in to comment.