kopia lustrzana https://github.com/micropython/micropython
github/workflows: Cache ESP-IDF checkout and installation.
Cache is keyed on the ESP-IDF version used in CI, so there shouldn't be any cache invalidation issues when ESP-IDF version changes. Restoring from cache takes approx 15s, compared to 2-3m to perform these steps (ESP-IDF tools install, ESP-IDF clone, ESP-IDF submodule clone) the first time. Cache size is approx 1.6GB, the git clone is tweaked as much as possible to keep the size down. Signed-off-by: Angus Gratton <angus@redyak.com.au>pull/13090/head
rodzic
58112fc49a
commit
9f620d2819
|
@ -22,7 +22,25 @@ jobs:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install packages
|
|
||||||
run: source tools/ci.sh && ci_esp32_idf50_setup
|
- id: idf_ver
|
||||||
|
name: Read the ESP-IDF version
|
||||||
|
run: source tools/ci.sh && echo "IDF_VER=$IDF_VER" | tee "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Cached ESP-IDF install
|
||||||
|
id: cache_esp_idf
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
./esp-idf/
|
||||||
|
~/.espressif/
|
||||||
|
!~/.espressif/dist/
|
||||||
|
~/.cache/pip/
|
||||||
|
key: esp-idf-${{ steps.idf_ver.outputs.IDF_VER }}
|
||||||
|
|
||||||
|
- name: Install ESP-IDF packages
|
||||||
|
if: steps.cache_esp_idf.outputs.cache-hit != 'true'
|
||||||
|
run: source tools/ci.sh && ci_esp32_idf_setup
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: source tools/ci.sh && ci_esp32_build
|
run: source tools/ci.sh && ci_esp32_build
|
||||||
|
|
11
tools/ci.sh
11
tools/ci.sh
|
@ -118,10 +118,15 @@ function ci_cc3200_build {
|
||||||
########################################################################################
|
########################################################################################
|
||||||
# ports/esp32
|
# ports/esp32
|
||||||
|
|
||||||
function ci_esp32_idf50_setup {
|
# GitHub tag of ESP-IDF to use for CI (note: must be a tag or a branch)
|
||||||
|
IDF_VER=v5.0.2
|
||||||
|
|
||||||
|
function ci_esp32_idf_setup {
|
||||||
pip3 install pyelftools
|
pip3 install pyelftools
|
||||||
git clone https://github.com/espressif/esp-idf.git
|
git clone --depth 1 --branch $IDF_VER https://github.com/espressif/esp-idf.git
|
||||||
git -C esp-idf checkout v5.0.2
|
# doing a treeless clone isn't quite as good as --shallow-submodules, but it
|
||||||
|
# is smaller than full clones and works when the submodule commit isn't a head.
|
||||||
|
git -C esp-idf submodule update --init --recursive --filter=tree:0
|
||||||
./esp-idf/install.sh
|
./esp-idf/install.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue