mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
CI: Cache pip wheels (#62755)
This commit is contained in:
parent
7d1de80926
commit
77ffd7b066
42
.github/workflows/ci.yaml
vendored
42
.github/workflows/ci.yaml
vendored
@ -11,8 +11,10 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
CACHE_VERSION: 5
|
CACHE_VERSION: 5
|
||||||
|
PIP_CACHE_VERSION: 1
|
||||||
DEFAULT_PYTHON: 3.8
|
DEFAULT_PYTHON: 3.8
|
||||||
PRE_COMMIT_CACHE: ~/.cache/pre-commit
|
PRE_COMMIT_CACHE: ~/.cache/pre-commit
|
||||||
|
PIP_CACHE: /tmp/pip-cache
|
||||||
SQLALCHEMY_WARN_20: 1
|
SQLALCHEMY_WARN_20: 1
|
||||||
PYTHONASYNCIODEBUG: 1
|
PYTHONASYNCIODEBUG: 1
|
||||||
|
|
||||||
@ -148,6 +150,11 @@ jobs:
|
|||||||
hashFiles('requirements.txt') }}-${{
|
hashFiles('requirements.txt') }}-${{
|
||||||
hashFiles('requirements_test.txt') }}-${{
|
hashFiles('requirements_test.txt') }}-${{
|
||||||
hashFiles('homeassistant/package_constraints.txt') }}"
|
hashFiles('homeassistant/package_constraints.txt') }}"
|
||||||
|
- name: Generate partial pip restore key
|
||||||
|
id: generate-pip-key
|
||||||
|
run: >-
|
||||||
|
echo "::set-output name=key::base-pip-${{ env.PIP_CACHE_VERSION }}-$(
|
||||||
|
date -u '+%Y-%m-%dT%H:%M:%s')"
|
||||||
- name: Restore base Python virtual environment
|
- name: Restore base Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v2.1.7
|
uses: actions/cache@v2.1.7
|
||||||
@ -165,13 +172,23 @@ jobs:
|
|||||||
# ${{ runner.os }}-${{ steps.python.outputs.python-version }}-base-venv-${{ env.CACHE_VERSION }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_test.txt') }}-
|
# ${{ runner.os }}-${{ steps.python.outputs.python-version }}-base-venv-${{ env.CACHE_VERSION }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_test.txt') }}-
|
||||||
# ${{ runner.os }}-${{ steps.python.outputs.python-version }}-base-venv-${{ env.CACHE_VERSION }}-${{ hashFiles('requirements.txt') }}-
|
# ${{ runner.os }}-${{ steps.python.outputs.python-version }}-base-venv-${{ env.CACHE_VERSION }}-${{ hashFiles('requirements.txt') }}-
|
||||||
# ${{ runner.os }}-${{ steps.python.outputs.python-version }}-base-venv-${{ env.CACHE_VERSION }}-
|
# ${{ runner.os }}-${{ steps.python.outputs.python-version }}-base-venv-${{ env.CACHE_VERSION }}-
|
||||||
|
- name: Restore pip wheel cache
|
||||||
|
if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||||
|
uses: actions/cache@v2.1.7
|
||||||
|
with:
|
||||||
|
path: ${{ env.PIP_CACHE }}
|
||||||
|
key: >-
|
||||||
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
||||||
|
steps.generate-pip-key.outputs.key }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-base-pip-${{ env.PIP_CACHE_VERSION }}-
|
||||||
- name: Create Python virtual environment
|
- name: Create Python virtual environment
|
||||||
if: steps.cache-venv.outputs.cache-hit != 'true'
|
if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
python -m venv venv
|
python -m venv venv
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
pip install -U "pip<20.3" setuptools wheel
|
pip install --cache-dir=$PIP_CACHE -U "pip<20.3" setuptools wheel
|
||||||
pip install -r requirements.txt -r requirements_test.txt
|
pip install --cache-dir=$PIP_CACHE -r requirements.txt -r requirements_test.txt
|
||||||
- name: Generate partial pre-commit restore key
|
- name: Generate partial pre-commit restore key
|
||||||
id: generate-pre-commit-key
|
id: generate-pre-commit-key
|
||||||
run: >-
|
run: >-
|
||||||
@ -519,6 +536,11 @@ jobs:
|
|||||||
hashFiles('requirements_test.txt') }}-${{
|
hashFiles('requirements_test.txt') }}-${{
|
||||||
hashFiles('requirements_all.txt') }}-${{
|
hashFiles('requirements_all.txt') }}-${{
|
||||||
hashFiles('homeassistant/package_constraints.txt') }}"
|
hashFiles('homeassistant/package_constraints.txt') }}"
|
||||||
|
- name: Generate partial pip restore key
|
||||||
|
id: generate-pip-key
|
||||||
|
run: >-
|
||||||
|
echo "::set-output name=key::pip-${{ env.PIP_CACHE_VERSION }}-$(
|
||||||
|
date -u '+%Y-%m-%dT%H:%M:%s')"
|
||||||
- name: Restore full Python ${{ matrix.python-version }} virtual environment
|
- name: Restore full Python ${{ matrix.python-version }} virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v2.1.7
|
uses: actions/cache@v2.1.7
|
||||||
@ -536,6 +558,16 @@ jobs:
|
|||||||
# ${{ runner.os }}-${{ matrix.python-version }}-venv-${{ env.CACHE_VERSION }}-${{ hashFiles('requirements_test.txt') }}-${{ hashFiles('requirements_all.txt') }}-
|
# ${{ runner.os }}-${{ matrix.python-version }}-venv-${{ env.CACHE_VERSION }}-${{ hashFiles('requirements_test.txt') }}-${{ hashFiles('requirements_all.txt') }}-
|
||||||
# ${{ runner.os }}-${{ matrix.python-version }}-venv-${{ env.CACHE_VERSION }}-${{ hashFiles('requirements_test.txt') }}-
|
# ${{ runner.os }}-${{ matrix.python-version }}-venv-${{ env.CACHE_VERSION }}-${{ hashFiles('requirements_test.txt') }}-
|
||||||
# ${{ runner.os }}-${{ matrix.python-version }}-venv-${{ env.CACHE_VERSION }}-
|
# ${{ runner.os }}-${{ matrix.python-version }}-venv-${{ env.CACHE_VERSION }}-
|
||||||
|
- name: Restore pip wheel cache
|
||||||
|
if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||||
|
uses: actions/cache@v2.1.7
|
||||||
|
with:
|
||||||
|
path: ${{ env.PIP_CACHE }}
|
||||||
|
key: >-
|
||||||
|
${{ runner.os }}-${{ matrix.python-version }}-pip-${{ env.PIP_CACHE_VERSION }}-${{
|
||||||
|
steps.generate-pip-key.outputs.key }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-${{ matrix.python-version }}-pip-${{ env.PIP_CACHE_VERSION }}-
|
||||||
- name: Create full Python ${{ matrix.python-version }} virtual environment
|
- name: Create full Python ${{ matrix.python-version }} virtual environment
|
||||||
if: steps.cache-venv.outputs.cache-hit != 'true'
|
if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
@ -545,9 +577,9 @@ jobs:
|
|||||||
|
|
||||||
python -m venv venv
|
python -m venv venv
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
pip install -U "pip<20.3" setuptools wheel
|
pip install --cache-dir=$PIP_CACHE -U "pip<20.3" setuptools wheel
|
||||||
pip install -r requirements_all.txt
|
pip install --cache-dir=$PIP_CACHE -r requirements_all.txt
|
||||||
pip install -r requirements_test.txt
|
pip install --cache-dir=$PIP_CACHE -r requirements_test.txt
|
||||||
pip install -e .
|
pip install -e .
|
||||||
|
|
||||||
pylint:
|
pylint:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user