-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use built-in pip caching from actions/setup-python in generated proje…
…ct (#3481)
- Loading branch information
1 parent
edff41d
commit a93773a
Showing
2 changed files
with
14 additions
and
26 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
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 |
---|---|---|
|
@@ -23,15 +23,13 @@ jobs: | |
- name: Checkout Code Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.9 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
python-version: "3.9" | ||
cache: pip | ||
|
||
# Run all pre-commit hooks on all the files. | ||
# Getting only staged files can be tricky in case a new PR is opened | ||
# since the action is run on a branch in detached head state | ||
- name: Install and Run Pre-commit | ||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] | ||
|
||
# With no caching at all the entire ci process takes 4m 30s to complete! | ||
|
@@ -80,27 +78,14 @@ jobs: | |
run: docker-compose -f local.yml down | ||
{%- else %} | ||
|
||
- name: Set up Python 3.9 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Get pip cache dir | ||
id: pip-cache-location | ||
run: | | ||
echo "::set-output name=dir::$(pip cache dir)" | ||
{%- raw %} | ||
|
||
- name: Cache pip Project Dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
# Get the location of pip cache dir | ||
path: ${{ steps.pip-cache-location.outputs.dir }} | ||
# Look to see if there is a cache hit for the corresponding requirements file | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/local.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
{%- endraw %} | ||
python-version: "3.9" | ||
cache: pip | ||
cache-dependency-path: | | ||
requirements/base.txt | ||
requirements/local.txt | ||
- name: Install Dependencies | ||
run: | | ||
|