-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use caching in Github Actions Workflow.
- Loading branch information
Showing
3 changed files
with
22 additions
and
3 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 |
---|---|---|
@@ -1,14 +1,31 @@ | ||
name: Setup Python env | ||
name: Setup Python Environment | ||
description: Install Python & Hatch | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: Set Linux Release Environment Variable | ||
shell: bash | ||
run: echo "LINUX_RELEASE=$(lsb_release -rs)" >> $GITHUB_ENV | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
|
||
# Cache the dependencies installed by Hatch so that we don't need to reinstall them on every run. | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
${{ env.pythonLocation }} | ||
# Save Hatch environments. | ||
~/.local/share/hatch | ||
# Save the package cache for Hatch. | ||
~/.cache/hatch | ||
# Save pre-commit environments. | ||
~/.cache/pre-commit | ||
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ env.LINUX_RELEASE }} | ||
|
||
- name: Install Hatch | ||
shell: bash | ||
run: pip3 install hatch |
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