mirror of
https://github.com/esphome/esphome.git
synced 2026-08-22 22:26:21 +00:00
[ci] Key PlatformIO cache on the Python version so a runner image bump does not serve a broken LibreTiny venv (#18512)
This commit is contained in:
@@ -545,24 +545,29 @@ jobs:
|
|||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
- name: Restore Python
|
- name: Restore Python
|
||||||
|
id: restore-python
|
||||||
uses: ./.github/actions/restore-python
|
uses: ./.github/actions/restore-python
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
cache-key: ${{ needs.common.outputs.cache-key }}
|
cache-key: ${{ needs.common.outputs.cache-key }}
|
||||||
|
|
||||||
|
# Key on the exact Python version as well: LibreTiny creates a venv under
|
||||||
|
# ~/.platformio/penv whose interpreter is a symlink into the runner's
|
||||||
|
# hosted toolcache, so a cache saved on an older runner image breaks once
|
||||||
|
# a new image ships a newer patch release and drops the old interpreter.
|
||||||
- name: Cache platformio
|
- name: Cache platformio
|
||||||
if: github.ref == 'refs/heads/dev' && matrix.pio_cache_key
|
if: github.ref == 'refs/heads/dev' && matrix.pio_cache_key
|
||||||
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||||
with:
|
with:
|
||||||
path: ~/.platformio
|
path: ~/.platformio
|
||||||
key: platformio-${{ matrix.pio_cache_key }}-${{ hashFiles('platformio.ini') }}
|
key: platformio-${{ matrix.pio_cache_key }}-${{ steps.restore-python.outputs.python-version }}-${{ hashFiles('platformio.ini') }}
|
||||||
|
|
||||||
- name: Cache platformio
|
- name: Cache platformio
|
||||||
if: github.ref != 'refs/heads/dev' && matrix.pio_cache_key
|
if: github.ref != 'refs/heads/dev' && matrix.pio_cache_key
|
||||||
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||||
with:
|
with:
|
||||||
path: ~/.platformio
|
path: ~/.platformio
|
||||||
key: platformio-${{ matrix.pio_cache_key }}-${{ hashFiles('platformio.ini') }}
|
key: platformio-${{ matrix.pio_cache_key }}-${{ steps.restore-python.outputs.python-version }}-${{ hashFiles('platformio.ini') }}
|
||||||
|
|
||||||
- name: Cache ESP-IDF install
|
- name: Cache ESP-IDF install
|
||||||
if: matrix.cache_idf
|
if: matrix.cache_idf
|
||||||
|
|||||||
Reference in New Issue
Block a user