-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
20 additions
and
36 deletions.
There are no files selected for viewing
28 changes: 14 additions & 14 deletions
28
.github/actions/cache_deps/action.yml → .github/actions/poetry_cached/action.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
name: Install and cache poetry/pre-commit dependencies | ||
name: Checkout and get (possibly cached) Poetry/Pre-commit virtualenvs | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up python | ||
- name: Set up Python | ||
id: setup-python | ||
uses: actions/setup-python@v5 | ||
|
||
- name: Install poetry | ||
- name: Install Poetry | ||
shell: bash | ||
run: | | ||
python -m pip install poetry | ||
python -m pip install -qqq poetry | ||
- name: Load cached poetry virtualenv | ||
- name: Load cached Poetry virtualenv, if available | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pypoetry/virtualenvs | ||
key: venv-${{ runner.os }}-${{ hashFiles('poetry.lock') }}-${{ hashFiles('.github/actions/cache_deps/action.yml') }}-${{ steps.setup-python.outputs.python-version }} | ||
|
||
- name: Install poetry dependencies, only if cache wasn't found | ||
shell: bash | ||
run: | | ||
poetry install --no-interaction | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
key: venv-${{ runner.os }}-${{ hashFiles('poetry.lock') }}-${{ hashFiles('.github/actions/poetry_cached/action.yml') }}-${{ steps.setup-python.outputs.python-version }} | ||
|
||
- name: Load cached pre-commit virtualenv | ||
id: cached-pre-commit | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}-${{ hashFiles('.github/actions/cache_deps/action.yml') }}-${{ steps.setup-python.outputs.python-version }} | ||
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}-${{ hashFiles('.github/actions/poetry_cached/action.yml') }}-${{ steps.setup-python.outputs.python-version }} | ||
|
||
- name: Install poetry dependencies, only if cache wasn't found | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: | | ||
poetry install --no-interaction | ||
- name: Install pre-commit hooks, only if cache wasn't found | ||
if: steps.cached-pre-commit.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: | | ||
poetry run pre-commit install-hooks | ||
if: steps.cached-pre-commit.outputs.cache-hit != 'true' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters