Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: use Python version in cache key #491

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'outdated_runs'
cancel_others: 'true'
skip_after_successful_duplicate: 'false'
concurrent_skipping: "outdated_runs"
cancel_others: "true"
skip_after_successful_duplicate: "false"

test:
needs: pre_job
Expand All @@ -45,7 +45,7 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: '1.8.3'
version: "1.8.3"
virtualenvs-in-project: true
- run: |
cat *.log
Expand Down Expand Up @@ -101,6 +101,7 @@ jobs:
with:
fetch-depth: 0
- name: Use Python
id: use-python
uses: actions/setup-python@v4
with:
python-version: "3.x"
Expand All @@ -109,11 +110,13 @@ jobs:
with:
virtualenvs-in-project: true
- name: Load cached venv
# I wonder if we can replace this whole step with with the "Use Python" step above's `cache` field?
# See: https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#outputs-and-environment-variables
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ hashFiles('**/poetry.lock') }}
key: venv-${{ hashFiles('**/poetry.lock') }}-${{ steps.use-python.outputs.python-version }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --all-extras --with dev
Expand Down
Loading