mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-03-03 19:08:15 +03:00
Use built-in pip caching from actions/setup-python in generated project (#3481)
This commit is contained in:
parent
edff41d1f3
commit
a93773ac39
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
|
@ -100,7 +100,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
python-version: "3.9"
|
python-version: "3.9"
|
||||||
cache: pip
|
cache: pip
|
||||||
cache-dependency-path: '**/requirements*.txt'
|
cache-dependency-path: |
|
||||||
|
requirements.txt
|
||||||
|
{{cookiecutter.project_slug}}/requirements/base.txt
|
||||||
|
{{cookiecutter.project_slug}}/requirements/local.txt
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pip install -r requirements.txt
|
run: pip install -r requirements.txt
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
|
|
|
@ -23,15 +23,13 @@ jobs:
|
||||||
- name: Checkout Code Repository
|
- name: Checkout Code Repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set up Python 3.9
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: "3.9"
|
||||||
|
cache: pip
|
||||||
|
|
||||||
# Run all pre-commit hooks on all the files.
|
- name: Run pre-commit
|
||||||
# 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
|
|
||||||
uses: pre-commit/action@v2.0.3
|
uses: pre-commit/action@v2.0.3
|
||||||
|
|
||||||
# With no caching at all the entire ci process takes 4m 30s to complete!
|
# 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
|
run: docker-compose -f local.yml down
|
||||||
{%- else %}
|
{%- else %}
|
||||||
|
|
||||||
- name: Set up Python 3.9
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: "3.9"
|
||||||
|
cache: pip
|
||||||
- name: Get pip cache dir
|
cache-dependency-path: |
|
||||||
id: pip-cache-location
|
requirements/base.txt
|
||||||
run: |
|
requirements/local.txt
|
||||||
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 %}
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|
Loading…
Reference in New Issue
Block a user