@@ -16,9 +16,6 @@ concurrency:
1616 group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1717 cancel-in-progress : true
1818
19- env :
20- CACHE_SUBMODULES : " ['extmod/ulab', 'lib/', 'tools/']"
21-
2219jobs :
2320 test :
2421 runs-on : ubuntu-20.04
2825 boards-arm : ${{ steps.set-matrix.outputs.boards-arm }}
2926 boards-espressif : ${{ steps.set-matrix.outputs.boards-espressif }}
3027 boards-riscv : ${{ steps.set-matrix.outputs.boards-riscv }}
31- cp-version : ${{ steps.cp-version .outputs.cp- version }}
28+ cp-version : ${{ steps.set-up-submodules .outputs.version }}
3229 steps :
3330 - name : Dump GitHub context
3431 run : echo "$GITHUB_CONTEXT"
@@ -45,28 +42,12 @@ jobs:
4542 python-version : " 3.x"
4643 - name : Duplicate USB VID/PID check
4744 run : python3 -u -m tools.ci_check_duplicate_usb_vid_pid
48- - name : Create submodule status
49- run : git submodule status ${{ join(fromJSON(env.CACHE_SUBMODULES), ' ') }} >> submodule_status
50- - name : Cache submodules
51- uses : actions/cache@v3
45+ - name : Set up submodules
46+ id : set-up-submodules
47+ uses : ./.github/actions/fetch_submodules
5248 with :
53- path : " .git/modules/\n ${{ join(fromJSON(env.CACHE_SUBMODULES), '\n ') }}"
54- key : submodules-common-${{ hashFiles('submodule_status') }}
55- - name : CircuitPython dependencies
56- run : |
57- python tools/ci_fetch_deps.py ${{ github.job }}
58- echo "::group::Fetch history and tags"
59- git fetch --no-recurse-submodules --shallow-since="2021-07-01" --tags https://github.com/adafruit/circuitpython HEAD
60- git fetch --no-recurse-submodules --shallow-since="2021-07-01" origin $GITHUB_SHA
61- git repack -d
62- echo "::endgroup::"
63- - name : CircuitPython version
64- id : cp-version
65- run : |
66- CP_VERSION=$(tools/describe)
67- echo "$CP_VERSION"
68- echo "CP_VERSION=$CP_VERSION" >> $GITHUB_ENV
69- echo "cp-version=$CP_VERSION" >> $GITHUB_OUTPUT
49+ cache : " cache"
50+ version : true
7051 - name : Install dependencies
7152 run : |
7253 sudo apt-get update
@@ -202,17 +183,8 @@ jobs:
202183 uses : actions/setup-python@v4
203184 with :
204185 python-version : " 3.x"
205- - name : Create submodule status
206- run : git submodule status ${{ join(fromJSON(env.CACHE_SUBMODULES), ' ') }} >> submodule_status
207- - name : Restore submodules
208- uses : actions/cache/restore@v3
209- with :
210- path : " .git/modules/\n ${{ join(fromJSON(env.CACHE_SUBMODULES), '\n ') }}"
211- key : submodules-common-${{ hashFiles('submodule_status') }}
212- - name : CircuitPython dependencies
213- run : python tools/ci_fetch_deps.py ${{ github.job }}
214- - name : CircuitPython version
215- run : tools/describe
186+ - name : Set up submodules
187+ uses : ./.github/actions/fetch_submodules
216188 - name : Versions
217189 run : |
218190 gcc --version
@@ -260,21 +232,12 @@ jobs:
260232 with :
261233 submodules : false
262234 fetch-depth : 1
263- - name : Create submodule status
264- run : git submodule status ${{ join(fromJSON(env.CACHE_SUBMODULES), ' ') }} >> submodule_status
265- - name : Restore submodules
266- uses : actions/cache/restore@v3
267- with :
268- path : " .git/modules/\n ${{ join(fromJSON(env.CACHE_SUBMODULES), '\n ') }}"
269- key : submodules-common-${{ hashFiles('submodule_status') }}
270- - name : CircuitPython dependencies
271- run : python tools/ci_fetch_deps.py ${{ github.job }}
272- - name : CircuitPython version
273- run : tools/describe
274235 - name : Set up python
275236 uses : actions/setup-python@v4
276237 with :
277238 python-version : " 3.x"
239+ - name : Set up submodules
240+ uses : ./.github/actions/fetch_submodules
278241 - name : Install dependencies
279242 run : |
280243 sudo apt-get update
@@ -343,16 +306,9 @@ jobs:
343306 uses : actions/setup-python@v4
344307 with :
345308 python-version : " 3.x"
346- - name : Create submodule status
347- run : git submodule status ${{ join(fromJSON(env.CACHE_SUBMODULES), ' ') }} >> submodule_status
348- - name : Restore submodules
349- uses : actions/cache/restore@v3
350- with :
351- path : " .git/modules/\n ${{ join(fromJSON(env.CACHE_SUBMODULES), '\n ') }}"
352- key : submodules-common-${{ hashFiles('submodule_status') }}
353- - name : CircuitPython dependencies
354- id : cp-deps
355- run : python tools/ci_fetch_deps.py ${{ matrix.board }}
309+ - name : Set up submodules
310+ id : set-up-submodules
311+ uses : ./.github/actions/fetch_submodules
356312 - name : Install dependencies
357313 run : |
358314 sudo apt-get install -y gettext mtools
@@ -379,7 +335,7 @@ jobs:
379335 python3 --version
380336 mkfs.fat --version || true
381337 - name : Build mpy-cross
382- if : ${{ steps.cp-deps .outputs.frozen_tags == 'True' }}
338+ if : ${{ steps.set-up-submodules .outputs.frozen == 'True' }}
383339 run : make -C mpy-cross -j2
384340 - name : Setup build failure matcher
385341 run : echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json"
@@ -425,16 +381,9 @@ jobs:
425381 uses : actions/setup-python@v4
426382 with :
427383 python-version : " 3.x"
428- - name : Create submodule status
429- run : git submodule status ${{ join(fromJSON(env.CACHE_SUBMODULES), ' ') }} >> submodule_status
430- - name : Restore submodules
431- uses : actions/cache/restore@v3
432- with :
433- path : " .git/modules/\n ${{ join(fromJSON(env.CACHE_SUBMODULES), '\n ') }}"
434- key : submodules-common-${{ hashFiles('submodule_status') }}
435- - name : CircuitPython dependencies
436- id : cp-deps
437- run : python tools/ci_fetch_deps.py ${{ matrix.board }}
384+ - name : Set up submodules
385+ id : set-up-submodules
386+ uses : ./.github/actions/fetch_submodules
438387 - uses : carlosperate/arm-none-eabi-gcc-action@v1
439388 with :
440389 release : ' 10-2020-q4'
@@ -448,7 +397,7 @@ jobs:
448397 arm-none-eabi-gcc --version
449398 python3 --version
450399 - name : Build mpy-cross
451- if : ${{ steps.cp-deps .outputs.frozen_tags == 'True' }}
400+ if : ${{ steps.set-up-submodules .outputs.frozen == 'True' }}
452401 run : make -C mpy-cross -j2
453402 - name : Setup build failure matcher
454403 run : echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json"
@@ -474,7 +423,6 @@ jobs:
474423 AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
475424
476425
477-
478426 build-espressif :
479427 runs-on : ubuntu-22.04
480428 needs : test
@@ -498,13 +446,6 @@ jobs:
498446 uses : actions/setup-python@v4
499447 with :
500448 python-version : " 3.10"
501- - name : Create submodule status
502- run : git submodule status ${{ join(fromJSON(env.CACHE_SUBMODULES), ' ') }} >> submodule_status
503- - name : Restore submodules
504- uses : actions/cache/restore@v3
505- with :
506- path : " .git/modules/\n ${{ join(fromJSON(env.CACHE_SUBMODULES), '\n ') }}"
507- key : submodules-common-${{ hashFiles('submodule_status') }}
508449 - name : Get IDF commit
509450 id : idf-commit
510451 run : |
@@ -518,19 +459,13 @@ jobs:
518459 .git/modules/ports/espressif/esp-idf
519460 ports/espressif/esp-idf
520461 key : submodules-idf-${{ steps.idf-commit.outputs.commit }}
521- - name : CircuitPython dependencies
522- id : cp-deps
523- run : python tools/ci_fetch_deps.py ${{ matrix.board }}
524- - name : CircuitPython version
525- run : tools/describe
526462 - name : Cache IDF tools
527463 uses : actions/cache@v3
528464 with :
529465 path : ${{ env.IDF_TOOLS_PATH }}
530466 key : ${{ runner.os }}-Python-${{ steps.setup-python.outputs.python-version }}-tools-idf-${{ steps.idf-commit.outputs.commit }}
531- - name : Clone IDF submodules
532- run : git submodule update --init --depth=1
533- working-directory : ${{ env.IDF_PATH }}
467+ - name : Initialize IDF submodules
468+ run : git submodule update --init --depth=1 --recursive $IDF_PATH
534469 - name : Install IDF tools
535470 run : |
536471 echo "Installing ESP-IDF tools"
@@ -539,6 +474,9 @@ jobs:
539474 echo "Installing Python environment and packages"
540475 $IDF_PATH/tools/idf_tools.py --non-interactive install-python-env
541476 rm -rf $IDF_TOOLS_PATH/dist
477+ - name : Set up submodules
478+ id : set-up-submodules
479+ uses : ./.github/actions/fetch_submodules
542480 - name : Install dependencies
543481 run : |
544482 source $IDF_PATH/export.sh
@@ -552,7 +490,7 @@ jobs:
552490 ninja --version
553491 cmake --version
554492 - name : Build mpy-cross
555- if : ${{ steps.cp-deps .outputs.frozen_tags == 'True' }}
493+ if : ${{ steps.set-up-submodules .outputs.frozen == 'True' }}
556494 run : make -C mpy-cross -j2
557495 - name : Setup build failure matcher
558496 run : echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json"
@@ -600,16 +538,9 @@ jobs:
600538 uses : actions/setup-python@v4
601539 with :
602540 python-version : " 3.x"
603- - name : Create submodule status
604- run : git submodule status ${{ join(fromJSON(env.CACHE_SUBMODULES), ' ') }} >> submodule_status
605- - name : Restore submodules
606- uses : actions/cache/restore@v3
607- with :
608- path : " .git/modules/\n ${{ join(fromJSON(env.CACHE_SUBMODULES), '\n ') }}"
609- key : submodules-common-${{ hashFiles('submodule_status') }}
610- - name : CircuitPython dependencies
611- id : cp-deps
612- run : python tools/ci_fetch_deps.py ${{ matrix.board }}
541+ - name : Set up submodules
542+ id : set-up-submodules
543+ uses : ./.github/actions/fetch_submodules
613544 - name : Install dependencies
614545 run : |
615546 sudo apt-get install -y gettext
@@ -622,7 +553,7 @@ jobs:
622553 riscv64-unknown-elf-gcc --version
623554 python3 --version
624555 - name : Build mpy-cross
625- if : ${{ steps.cp-deps .outputs.frozen_tags == 'True' }}
556+ if : ${{ steps.set-up-submodules .outputs.frozen == 'True' }}
626557 run : make -C mpy-cross -j2
627558 - name : Setup build failure matcher
628559 run : echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json"
0 commit comments