mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Use setup-python check-latest option [ci] (#80078)
This commit is contained in:
parent
a391b8dd9d
commit
bcbf99243d
60
.github/workflows/ci.yaml
vendored
60
.github/workflows/ci.yaml
vendored
@ -23,10 +23,8 @@ env:
|
|||||||
CACHE_VERSION: 1
|
CACHE_VERSION: 1
|
||||||
PIP_CACHE_VERSION: 1
|
PIP_CACHE_VERSION: 1
|
||||||
HA_SHORT_VERSION: 2022.11
|
HA_SHORT_VERSION: 2022.11
|
||||||
# Pin latest Python patch versions to avoid issues
|
DEFAULT_PYTHON: 3.9
|
||||||
# with runners using different versions.
|
ALL_PYTHON_VERSIONS: "['3.9', '3.10']"
|
||||||
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
|
||||||
@ -69,7 +67,7 @@ jobs:
|
|||||||
- name: Generate partial pre-commit restore key
|
- name: Generate partial pre-commit restore key
|
||||||
id: generate_pre-commit_cache_key
|
id: generate_pre-commit_cache_key
|
||||||
run: >-
|
run: >-
|
||||||
echo "::set-output name=key::${{ env.CACHE_VERSION }}-${{ env.DEFAULT_PYTHON }}-${{
|
echo "::set-output name=key::pre-commit-${{ env.CACHE_VERSION }}-${{
|
||||||
hashFiles('.pre-commit-config.yaml') }}"
|
hashFiles('.pre-commit-config.yaml') }}"
|
||||||
- name: Filter for core changes
|
- name: Filter for core changes
|
||||||
uses: dorny/paths-filter@v2.10.2
|
uses: dorny/paths-filter@v2.10.2
|
||||||
@ -175,12 +173,15 @@ jobs:
|
|||||||
uses: actions/setup-python@v4.3.0
|
uses: actions/setup-python@v4.3.0
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
|
check-latest: true
|
||||||
- name: Restore base Python virtual environment
|
- name: Restore base Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.10
|
uses: actions/cache@v3.0.10
|
||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: ${{ runner.os }}-venv-${{ needs.info.outputs.pre-commit_cache_key }}
|
key: >-
|
||||||
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{
|
||||||
|
needs.info.outputs.pre-commit_cache_key }}
|
||||||
- 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: |
|
||||||
@ -193,7 +194,9 @@ jobs:
|
|||||||
uses: actions/cache@v3.0.10
|
uses: actions/cache@v3.0.10
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PRE_COMMIT_CACHE }}
|
path: ${{ env.PRE_COMMIT_CACHE }}
|
||||||
key: ${{ runner.os }}-pre-commit-${{ needs.info.outputs.pre-commit_cache_key }}
|
key: >-
|
||||||
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
||||||
|
needs.info.outputs.pre-commit_cache_key }}
|
||||||
- name: Install pre-commit dependencies
|
- name: Install pre-commit dependencies
|
||||||
if: steps.cache-precommit.outputs.cache-hit != 'true'
|
if: steps.cache-precommit.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
@ -214,12 +217,15 @@ jobs:
|
|||||||
id: python
|
id: python
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
|
check-latest: true
|
||||||
- name: Restore base Python virtual environment
|
- name: Restore base Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.10
|
uses: actions/cache@v3.0.10
|
||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: ${{ runner.os }}-venv-${{ needs.info.outputs.pre-commit_cache_key }}
|
key: >-
|
||||||
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{
|
||||||
|
needs.info.outputs.pre-commit_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'
|
||||||
run: |
|
run: |
|
||||||
@ -230,7 +236,9 @@ jobs:
|
|||||||
uses: actions/cache@v3.0.10
|
uses: actions/cache@v3.0.10
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PRE_COMMIT_CACHE }}
|
path: ${{ env.PRE_COMMIT_CACHE }}
|
||||||
key: ${{ runner.os }}-pre-commit-${{ needs.info.outputs.pre-commit_cache_key }}
|
key: >-
|
||||||
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
||||||
|
needs.info.outputs.pre-commit_cache_key }}
|
||||||
- name: Fail job if pre-commit cache restore failed
|
- name: Fail job if pre-commit cache restore failed
|
||||||
if: steps.cache-precommit.outputs.cache-hit != 'true'
|
if: steps.cache-precommit.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
@ -263,12 +271,15 @@ jobs:
|
|||||||
id: python
|
id: python
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
|
check-latest: true
|
||||||
- name: Restore base Python virtual environment
|
- name: Restore base Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.10
|
uses: actions/cache@v3.0.10
|
||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: ${{ runner.os }}-venv-${{ needs.info.outputs.pre-commit_cache_key }}
|
key: >-
|
||||||
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{
|
||||||
|
needs.info.outputs.pre-commit_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'
|
||||||
run: |
|
run: |
|
||||||
@ -279,7 +290,9 @@ jobs:
|
|||||||
uses: actions/cache@v3.0.10
|
uses: actions/cache@v3.0.10
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PRE_COMMIT_CACHE }}
|
path: ${{ env.PRE_COMMIT_CACHE }}
|
||||||
key: ${{ runner.os }}-pre-commit-${{ needs.info.outputs.pre-commit_cache_key }}
|
key: >-
|
||||||
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
||||||
|
needs.info.outputs.pre-commit_cache_key }}
|
||||||
- name: Fail job if pre-commit cache restore failed
|
- name: Fail job if pre-commit cache restore failed
|
||||||
if: steps.cache-precommit.outputs.cache-hit != 'true'
|
if: steps.cache-precommit.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
@ -315,12 +328,15 @@ jobs:
|
|||||||
id: python
|
id: python
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
|
check-latest: true
|
||||||
- name: Restore base Python virtual environment
|
- name: Restore base Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.10
|
uses: actions/cache@v3.0.10
|
||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: ${{ runner.os }}-venv-${{ needs.info.outputs.pre-commit_cache_key }}
|
key: >-
|
||||||
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{
|
||||||
|
needs.info.outputs.pre-commit_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'
|
||||||
run: |
|
run: |
|
||||||
@ -331,7 +347,9 @@ jobs:
|
|||||||
uses: actions/cache@v3.0.10
|
uses: actions/cache@v3.0.10
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PRE_COMMIT_CACHE }}
|
path: ${{ env.PRE_COMMIT_CACHE }}
|
||||||
key: ${{ runner.os }}-pre-commit-${{ needs.info.outputs.pre-commit_cache_key }}
|
key: >-
|
||||||
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
||||||
|
needs.info.outputs.pre-commit_cache_key }}
|
||||||
- name: Fail job if pre-commit cache restore failed
|
- name: Fail job if pre-commit cache restore failed
|
||||||
if: steps.cache-precommit.outputs.cache-hit != 'true'
|
if: steps.cache-precommit.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
@ -356,12 +374,15 @@ jobs:
|
|||||||
id: python
|
id: python
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
|
check-latest: true
|
||||||
- name: Restore base Python virtual environment
|
- name: Restore base Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.10
|
uses: actions/cache@v3.0.10
|
||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
key: ${{ runner.os }}-venv-${{ needs.info.outputs.pre-commit_cache_key }}
|
key: >-
|
||||||
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{
|
||||||
|
needs.info.outputs.pre-commit_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'
|
||||||
run: |
|
run: |
|
||||||
@ -372,7 +393,9 @@ jobs:
|
|||||||
uses: actions/cache@v3.0.10
|
uses: actions/cache@v3.0.10
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PRE_COMMIT_CACHE }}
|
path: ${{ env.PRE_COMMIT_CACHE }}
|
||||||
key: ${{ runner.os }}-pre-commit-${{ needs.info.outputs.pre-commit_cache_key }}
|
key: >-
|
||||||
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
||||||
|
needs.info.outputs.pre-commit_cache_key }}
|
||||||
- name: Fail job if pre-commit cache restore failed
|
- name: Fail job if pre-commit cache restore failed
|
||||||
if: steps.cache-precommit.outputs.cache-hit != 'true'
|
if: steps.cache-precommit.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
@ -478,6 +501,7 @@ jobs:
|
|||||||
uses: actions/setup-python@v4.3.0
|
uses: actions/setup-python@v4.3.0
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
check-latest: true
|
||||||
- name: Generate partial pip restore key
|
- name: Generate partial pip restore key
|
||||||
id: generate-pip-key
|
id: generate-pip-key
|
||||||
run: >-
|
run: >-
|
||||||
@ -541,6 +565,7 @@ jobs:
|
|||||||
uses: actions/setup-python@v4.3.0
|
uses: actions/setup-python@v4.3.0
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
|
check-latest: true
|
||||||
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment
|
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.10
|
uses: actions/cache@v3.0.10
|
||||||
@ -573,6 +598,7 @@ jobs:
|
|||||||
uses: actions/setup-python@v4.3.0
|
uses: actions/setup-python@v4.3.0
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
|
check-latest: true
|
||||||
- name: Restore base Python virtual environment
|
- name: Restore base Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.10
|
uses: actions/cache@v3.0.10
|
||||||
@ -606,6 +632,7 @@ jobs:
|
|||||||
uses: actions/setup-python@v4.3.0
|
uses: actions/setup-python@v4.3.0
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
|
check-latest: true
|
||||||
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment
|
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.10
|
uses: actions/cache@v3.0.10
|
||||||
@ -650,6 +677,7 @@ jobs:
|
|||||||
uses: actions/setup-python@v4.3.0
|
uses: actions/setup-python@v4.3.0
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
|
check-latest: true
|
||||||
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment
|
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v3.0.10
|
uses: actions/cache@v3.0.10
|
||||||
@ -698,6 +726,7 @@ jobs:
|
|||||||
uses: actions/setup-python@v4.3.0
|
uses: actions/setup-python@v4.3.0
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
check-latest: true
|
||||||
- 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@v3.0.10
|
uses: actions/cache@v3.0.10
|
||||||
@ -752,6 +781,7 @@ jobs:
|
|||||||
uses: actions/setup-python@v4.3.0
|
uses: actions/setup-python@v4.3.0
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
check-latest: true
|
||||||
- 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@v3.0.10
|
uses: actions/cache@v3.0.10
|
||||||
|
Loading…
x
Reference in New Issue
Block a user