@@ -485,6 +485,8 @@ jobs:
485
485
if : ${{ needs.test.outputs.boards-espressif != '[]' }}
486
486
env :
487
487
CP_VERSION : ${{ needs.test.outputs.cp-version }}
488
+ IDF_PATH : ${{ github.workspace }}/ports/espressif/esp-idf
489
+ IDF_TOOLS_PATH : ${{ github.workspace }}/.idf_tools
488
490
strategy :
489
491
fail-fast : false
490
492
matrix :
@@ -496,7 +498,7 @@ jobs:
496
498
submodules : false
497
499
fetch-depth : 1
498
500
- name : Set up python
499
- id : py3
501
+ id : setup-python
500
502
uses : actions/setup-python@v4
501
503
with :
502
504
python-version : " 3.10"
@@ -511,21 +513,32 @@ jobs:
511
513
lib/
512
514
tools/
513
515
key : submodules-common-${{ hashFiles('submodule_status') }}
516
+ - name : Get IDF commit
517
+ id : idf-commit
518
+ run : |
519
+ COMMIT=$(git submodule status ports/espressif/esp-idf | grep -o -P '(?<=^-).*(?= )')
520
+ echo "$COMMIT"
521
+ echo "commit=$COMMIT" >> $GITHUB_OUTPUT
522
+ - name : Cache IDF submodules
523
+ uses : actions/cache@v3
524
+ with :
525
+ path : |
526
+ .git/modules/ports/espressif/esp-idf
527
+ ports/espressif/esp-idf
528
+ key : submodules-idf-${{ steps.idf-commit.outputs.commit }}
514
529
- name : CircuitPython dependencies
515
530
id : cp-deps
516
531
run : python tools/ci_fetch_deps.py ${{ matrix.board }}
517
532
- name : CircuitPython version
518
533
run : tools/describe
519
- - uses : actions/cache@v3
520
- name : Fetch IDF tool cache
521
- id : idf-cache
534
+ - name : Cache IDF tools
535
+ uses : actions/cache@v3
522
536
with :
523
- path : ${{ github.workspace }}/.idf_tools
524
- key : ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp- idf/HEAD') }}-${{ steps.py3 .outputs.python-path }}-20220404
537
+ path : ${{ env.IDF_TOOLS_PATH }}
538
+ key : ${{ runner.os }}-idf-tools-${{ steps. idf-commit.outputs.commit }}-${{ steps.setup-python .outputs.python-version }}
525
539
- name : Clone IDF submodules
526
- run : cd $IDF_PATH && git submodule update --init --depth=1
527
- env :
528
- IDF_PATH : ${{ github.workspace }}/ports/espressif/esp-idf
540
+ run : git submodule update --init --depth=1
541
+ working-directory : ${{ env.IDF_PATH }}
529
542
- name : Install IDF tools
530
543
run : |
531
544
echo "Installing ESP-IDF tools"
@@ -534,28 +547,18 @@ jobs:
534
547
echo "Installing Python environment and packages"
535
548
$IDF_PATH/tools/idf_tools.py --non-interactive install-python-env
536
549
rm -rf $IDF_TOOLS_PATH/dist
537
- env :
538
- IDF_PATH : ${{ github.workspace }}/ports/espressif/esp-idf
539
- IDF_TOOLS_PATH : ${{ github.workspace }}/.idf_tools
540
550
- name : Install dependencies
541
551
run : |
542
552
source $IDF_PATH/export.sh
543
553
sudo apt-get install -y gettext ninja-build
544
554
pip install -r requirements-dev.txt
545
- env :
546
- IDF_PATH : ${{ github.workspace }}/ports/espressif/esp-idf
547
- IDF_TOOLS_PATH : ${{ github.workspace }}/.idf_tools
548
555
- name : Versions
549
556
run : |
550
557
source $IDF_PATH/export.sh
551
558
gcc --version
552
559
python3 --version
553
560
ninja --version
554
561
cmake --version
555
- shell : bash
556
- env :
557
- IDF_PATH : ${{ github.workspace }}/ports/espressif/esp-idf
558
- IDF_TOOLS_PATH : ${{ github.workspace }}/.idf_tools
559
562
- name : Build mpy-cross
560
563
if : ${{ steps.cp-deps.outputs.frozen_tags == 'True' }}
561
564
run : make -C mpy-cross -j2
@@ -566,10 +569,7 @@ jobs:
566
569
source $IDF_PATH/export.sh
567
570
python3 -u build_release_files.py
568
571
working-directory : tools
569
- shell : bash
570
572
env :
571
- IDF_PATH : ${{ github.workspace }}/ports/espressif/esp-idf
572
- IDF_TOOLS_PATH : ${{ github.workspace }}/.idf_tools
573
573
BOARDS : ${{ matrix.board }}
574
574
- uses : actions/upload-artifact@v3
575
575
with :
0 commit comments