mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Pin Python patch versions [ci] (#78830)
This commit is contained in:
parent
774d5138ca
commit
6f782628b9
32
.github/workflows/ci.yaml
vendored
32
.github/workflows/ci.yaml
vendored
@ -23,7 +23,10 @@ env:
|
|||||||
CACHE_VERSION: 1
|
CACHE_VERSION: 1
|
||||||
PIP_CACHE_VERSION: 1
|
PIP_CACHE_VERSION: 1
|
||||||
HA_SHORT_VERSION: 2022.10
|
HA_SHORT_VERSION: 2022.10
|
||||||
DEFAULT_PYTHON: 3.9
|
# Pin latest Python patch versions to avoid issues
|
||||||
|
# with runners using different versions.
|
||||||
|
DEFAULT_PYTHON: 3.9.14
|
||||||
|
ALL_PYTHON_VERSIONS: "['3.9.14', '3.10.7']"
|
||||||
PRE_COMMIT_CACHE: ~/.cache/pre-commit
|
PRE_COMMIT_CACHE: ~/.cache/pre-commit
|
||||||
PIP_CACHE: /tmp/pip-cache
|
PIP_CACHE: /tmp/pip-cache
|
||||||
SQLALCHEMY_WARN_20: 1
|
SQLALCHEMY_WARN_20: 1
|
||||||
@ -46,6 +49,7 @@ jobs:
|
|||||||
pre-commit_cache_key: ${{ steps.generate_pre-commit_cache_key.outputs.key }}
|
pre-commit_cache_key: ${{ steps.generate_pre-commit_cache_key.outputs.key }}
|
||||||
python_cache_key: ${{ steps.generate_python_cache_key.outputs.key }}
|
python_cache_key: ${{ steps.generate_python_cache_key.outputs.key }}
|
||||||
requirements: ${{ steps.core.outputs.requirements }}
|
requirements: ${{ steps.core.outputs.requirements }}
|
||||||
|
python_versions: ${{ steps.info.outputs.python_versions }}
|
||||||
test_full_suite: ${{ steps.info.outputs.test_full_suite }}
|
test_full_suite: ${{ steps.info.outputs.test_full_suite }}
|
||||||
test_group_count: ${{ steps.info.outputs.test_group_count }}
|
test_group_count: ${{ steps.info.outputs.test_group_count }}
|
||||||
test_groups: ${{ steps.info.outputs.test_groups }}
|
test_groups: ${{ steps.info.outputs.test_groups }}
|
||||||
@ -143,6 +147,8 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Output & sent to GitHub Actions
|
# Output & sent to GitHub Actions
|
||||||
|
echo "python_versions: ${ALL_PYTHON_VERSIONS}"
|
||||||
|
echo "::set-output name=python_versions::${ALL_PYTHON_VERSIONS}"
|
||||||
echo "test_full_suite: ${test_full_suite}"
|
echo "test_full_suite: ${test_full_suite}"
|
||||||
echo "::set-output name=test_full_suite::${test_full_suite}"
|
echo "::set-output name=test_full_suite::${test_full_suite}"
|
||||||
echo "integrations_glob: ${integrations_glob}"
|
echo "integrations_glob: ${integrations_glob}"
|
||||||
@ -463,7 +469,7 @@ jobs:
|
|||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.9", "3.10"]
|
python-version: ${{ fromJSON(needs.info.outputs.python_versions) }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v3.0.2
|
uses: actions/checkout@v3.0.2
|
||||||
@ -483,7 +489,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: >-
|
key: >-
|
||||||
${{ runner.os }}-${{ matrix.python-version }}-${{
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
||||||
needs.info.outputs.python_cache_key }}
|
needs.info.outputs.python_cache_key }}
|
||||||
- name: Restore pip wheel cache
|
- name: Restore pip wheel cache
|
||||||
if: steps.cache-venv.outputs.cache-hit != 'true'
|
if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||||
@ -491,10 +497,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: ${{ env.PIP_CACHE }}
|
path: ${{ env.PIP_CACHE }}
|
||||||
key: >-
|
key: >-
|
||||||
${{ runner.os }}-${{ matrix.python-version }}-${{
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
||||||
steps.generate-pip-key.outputs.key }}
|
steps.generate-pip-key.outputs.key }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-${{ matrix.python-version }}-pip-${{ env.PIP_CACHE_VERSION }}-${{ env.HA_SHORT_VERSION }}-
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-pip-${{ env.PIP_CACHE_VERSION }}-${{ env.HA_SHORT_VERSION }}-
|
||||||
- name: Install additional OS dependencies
|
- name: Install additional OS dependencies
|
||||||
if: steps.cache-venv.outputs.cache-hit != 'true'
|
if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
@ -541,7 +547,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: >-
|
key: >-
|
||||||
${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-${{
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
||||||
needs.info.outputs.python_cache_key }}
|
needs.info.outputs.python_cache_key }}
|
||||||
- name: Fail job if Python cache restore failed
|
- name: Fail job if Python cache restore failed
|
||||||
if: steps.cache-venv.outputs.cache-hit != 'true'
|
if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||||
@ -573,7 +579,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: >-
|
key: >-
|
||||||
${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-${{
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
||||||
needs.info.outputs.python_cache_key }}
|
needs.info.outputs.python_cache_key }}
|
||||||
- name: Fail job if Python cache restore failed
|
- name: Fail job if Python cache restore failed
|
||||||
if: steps.cache-venv.outputs.cache-hit != 'true'
|
if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||||
@ -606,7 +612,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: >-
|
key: >-
|
||||||
${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-${{
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
||||||
needs.info.outputs.python_cache_key }}
|
needs.info.outputs.python_cache_key }}
|
||||||
- name: Fail job if Python cache restore failed
|
- name: Fail job if Python cache restore failed
|
||||||
if: steps.cache-venv.outputs.cache-hit != 'true'
|
if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||||
@ -650,7 +656,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: >-
|
key: >-
|
||||||
${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-${{
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
||||||
needs.info.outputs.python_cache_key }}
|
needs.info.outputs.python_cache_key }}
|
||||||
- name: Fail job if Python cache restore failed
|
- name: Fail job if Python cache restore failed
|
||||||
if: steps.cache-venv.outputs.cache-hit != 'true'
|
if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||||
@ -682,7 +688,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.9", "3.10"]
|
python-version: ${{ fromJson(needs.info.outputs.python_versions) }}
|
||||||
name: Run pip check ${{ matrix.python-version }}
|
name: Run pip check ${{ matrix.python-version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
@ -698,7 +704,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: >-
|
key: >-
|
||||||
${{ runner.os }}-${{ matrix.python-version }}-${{
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
||||||
needs.info.outputs.python_cache_key }}
|
needs.info.outputs.python_cache_key }}
|
||||||
- name: Fail job if Python cache restore failed
|
- name: Fail job if Python cache restore failed
|
||||||
if: steps.cache-venv.outputs.cache-hit != 'true'
|
if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||||
@ -729,7 +735,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
group: ${{ fromJson(needs.info.outputs.test_groups) }}
|
group: ${{ fromJson(needs.info.outputs.test_groups) }}
|
||||||
python-version: ["3.9", "3.10"]
|
python-version: ${{ fromJson(needs.info.outputs.python_versions) }}
|
||||||
name: >-
|
name: >-
|
||||||
Run tests Python ${{ matrix.python-version }} (${{ matrix.group }})
|
Run tests Python ${{ matrix.python-version }} (${{ matrix.group }})
|
||||||
steps:
|
steps:
|
||||||
@ -751,7 +757,7 @@ jobs:
|
|||||||
uses: actions/cache@v3.0.8
|
uses: actions/cache@v3.0.8
|
||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: ${{ runner.os }}-${{ matrix.python-version }}-${{
|
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
||||||
needs.info.outputs.python_cache_key }}
|
needs.info.outputs.python_cache_key }}
|
||||||
- name: Fail job if Python cache restore failed
|
- name: Fail job if Python cache restore failed
|
||||||
if: steps.cache-venv.outputs.cache-hit != 'true'
|
if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user