-
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
3 changed files
with
41 additions
and
10 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Install and cache poetry/pre-commit dependencies | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up python | ||
id: setup-python | ||
uses: actions/setup-python@v5 | ||
|
||
- name: Install poetry | ||
run: | | ||
python -m pip install poetry | ||
- name: Load cached poetry virtualenv | ||
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.yml') }}-${{ steps.setup-python.outputs.python-version }} | ||
|
||
- name: Install poetry dependencies, only if cache wasn't found | ||
run: | | ||
poetry install --no-interaction | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
|
||
- 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.yml') }}-${{ steps.setup-python.outputs.python-version }} | ||
|
||
- name: Install pre-commit hooks, only if cache wasn't found | ||
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