77 types : [created]
88
99env :
10- MICROPYTHON_VERSION : v1.21.0
11- WORKFLOW_VERSION : v1
10+ MICROPYTHON_VERSION : v1.22.1
1211
1312jobs :
14- deps :
15- runs-on : ubuntu-20.04
16- name : Dependencies
17- steps :
18- - name : Workspace Cache
19- id : cache
20- uses : actions/cache@v3
21- with :
22- path : ${{runner.workspace}}
23- key : workspace-micropython-${{env.MICROPYTHON_VERSION}}-${{env.WORKFLOW_VERSION}}
24- restore-keys : |
25- workspace-micropython-${{env.MICROPYTHON_VERSION}}-${{env.WORKFLOW_VERSION}}
26-
27- # Check out MicroPython
28- - name : Checkout MicroPython
29- if : steps.cache.outputs.cache-hit != 'true'
30- uses : actions/checkout@v3
31- with :
32- repository : micropython/micropython
33- ref : ${{env.MICROPYTHON_VERSION}}
34- submodules : false # MicroPython submodules are hideously broken
35- path : micropython
36-
37- # Check out MicroPython Libs
38- - name : Checkout MicroPython Libs
39- if : steps.cache.outputs.cache-hit != 'true'
40- uses : actions/checkout@v3
41- with :
42- repository : micropython/micropython-lib
43- path : micropython-lib
44-
45- - name : Fetch Pico submodules
46- if : steps.cache.outputs.cache-hit != 'true'
47- shell : bash
48- working-directory : micropython/ports/rp2
49- run : |
50- git submodule update --init ../../lib/pico-sdk
51- git submodule update --init ../../lib/cyw43-driver
52- git submodule update --init ../../lib/lwip
53- git submodule update --init ../../lib/mbedtls
54- git submodule update --init ../../lib/micropython-lib
55- git submodule update --init ../../lib/tinyusb
56- git submodule update --init ../../lib/btstack
57-
58- - name : Build mpy-cross
59- if : steps.cache.outputs.cache-hit != 'true'
60- shell : bash
61- working-directory : micropython/mpy-cross
62- run : make
63-
6413 build :
65- needs : deps
66- name : ${{matrix.name}} (${{matrix.board}})
14+ name : ${{ matrix.name }} (${{ matrix.board }})
6715 runs-on : ubuntu-20.04
6816 strategy :
6917 matrix :
8230 board : PIMORONI_TUFTY2040
8331 - name : enviro
8432 board : PICO_W_ENVIRO
85- patch : true
8633 - name : galactic_unicorn
8734 board : RPI_PICO_W
8835 - name : cosmic_unicorn
@@ -91,93 +38,91 @@ jobs:
9138 board : RPI_PICO_W
9239 - name : inky_frame
9340 board : PICO_W_INKY
94- patch : true
9541
9642 env :
9743 # MicroPython version will be contained in github.event.release.tag_name for releases
98- RELEASE_FILE : pimoroni-${{matrix.name}}-${{github.event.release.tag_name || github.sha}}-micropython
99- MICROPY_BOARD_DIR : " $GITHUB_WORKSPACE/pimoroni-pico-${{ github.sha }}/micropython/board/${{ matrix.BOARD }}"
100- USER_C_MODULES : " $GITHUB_WORKSPACE/pimoroni-pico-${{ github.sha }}/micropython/modules/micropython-${{matrix.name}}.cmake"
44+ RELEASE_FILE : pimoroni-${{ matrix.name }}-${{ github.event.release.tag_name || github.sha }}-micropython
45+ PIMORONI_PICO_DIR : " ${{ github.workspace }}/pimoroni-pico-${{ github.sha }}"
46+ MICROPY_BOARD_DIR : " ${{ github.workspace }}/pimoroni-pico-${{ github.sha }}/micropython/board/${{ matrix.BOARD }}"
47+ USER_C_MODULES : " ${{ github.workspace }}/pimoroni-pico-${{ github.sha }}/micropython/modules/micropython-${{ matrix.name }}.cmake"
48+ TAG_OR_SHA : ${{ github.event.release.tag_name || github.sha }}
49+ MICROPY_BOARD : ${{ matrix.board }}
50+ BOARD_NAME : ${{ matrix.name }}
51+ BUILD_TOOLS : pimoroni-pico-${{ github.sha }}/ci/micropython.sh
10152
10253 steps :
10354 - name : Compiler Cache
10455 uses : actions/cache@v3
10556 with :
10657 path : /home/runner/.ccache
107- key : ccache-micropython-${{matrix.name}}-${{github.ref}}-${{github.sha}}
58+ key : ccache-micropython-${{ matrix.name }}-${{ github.ref }}-${{ github.sha }}
10859 restore-keys : |
109- ccache-micropython-${{matrix.name}}-${{github.ref}}
110- ccache-micropython-${{matrix.name}}-
111-
112- - name : Workspace Cache
113- uses : actions/cache@v3
114- with :
115- path : ${{runner.workspace}}
116- key : workspace-micropython-${{env.MICROPYTHON_VERSION}}-${{env.WORKFLOW_VERSION}}
117- restore-keys : |
118- workspace-micropython-${{env.MICROPYTHON_VERSION}}-${{env.WORKFLOW_VERSION}}
60+ ccache-micropython-${{ matrix.name }}-${{ github.ref }}
61+ ccache-micropython-${{ matrix.name }}-
11962
120- - name : Install Compiler & CCache
121- if : runner.os == 'Linux'
122- run : |
123- sudo apt update && sudo apt install ccache gcc-arm-none-eabi
124-
125- - uses : actions/checkout@v3
63+ - uses : actions/checkout@v4
12664 with :
12765 submodules : true
12866 path : pimoroni-pico-${{ github.sha }}
12967
130- - name : Set MicroPython Version Env Vars
131- shell : bash
68+ - name : Install Arm GNU Toolchain (arm-none-eabi-gcc)
69+ uses : carlosperate/arm-none-eabi-gcc-action@v1
70+ with :
71+ release : ' 9-2020-q2'
72+
73+ - name : Install CCache
13274 run : |
133- echo "MICROPY_GIT_TAG=$MICROPYTHON_VERSION, ${{matrix.name}} ${{github.event.release.tag_name || github.sha}}" >> $GITHUB_ENV
134- echo "MICROPY_GIT_HASH=$MICROPYTHON_VERSION-${{github.event.release.tag_name || github.sha}}" >> $GITHUB_ENV
75+ source $BUILD_TOOLS
76+ apt_install_build_deps
77+
78+ - name : Checkout MicroPython & Submodules
79+ run : |
80+ source $BUILD_TOOLS
81+ micropython_clone
82+
83+ - name : Build MPY Cross
84+ run : |
85+ source $BUILD_TOOLS
86+ micropython_build_mpy_cross
13587
13688 - name : " HACK: CMakeLists.txt Disable C++ Exceptions Patch"
13789 shell : bash
138- working-directory : micropython
139- run : git apply $GITHUB_WORKSPACE/pimoroni-pico-${{ github.sha }}/micropython/micropython_nano_specs.patch
90+ run : |
91+ source $BUILD_TOOLS
92+ hack_patch_micropython_disable_exceptions
14093
14194 - name : " HACK: Pico SDK Patch"
142- if : matrix.patch == true
14395 shell : bash
144- working-directory : micropython
14596 run : |
146- $GITHUB_WORKSPACE/pimoroni-pico-${{ github.sha }}/micropython/board/pico-sdk-patch.sh ${{matrix.board}}
97+ source $BUILD_TOOLS
98+ hack_patch_pico_sdk
14799
148100 - name : Configure MicroPython
149101 shell : bash
150- working-directory : micropython/ports/rp2
151- run : |
152- cmake -S . -B build-${{matrix.name}} -DPICO_BUILD_DOCS=0 -DUSER_C_MODULES=${{env.USER_C_MODULES}} -DMICROPY_BOARD_DIR=${{env.MICROPY_BOARD_DIR}} -DMICROPY_BOARD=${{matrix.board}} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
153-
154- - name : Build MicroPython # Multiple simultaneous jobs trigger https://github.com/pimoroni/pimoroni-pico/issues/761
155- shell : bash
156- working-directory : micropython/ports/rp2
157102 run : |
158- ccache --zero-stats || true
159- cmake --build build-${{matrix.name}} -j 1
160- ccache --show-stats || true
103+ source $BUILD_TOOLS
104+ micropython_version
105+ cmake_configure
161106
162- - name : Rename .uf2 for artifact
107+ - name : Build MicroPython
163108 shell : bash
164- working-directory : micropython/ports/rp2/build-${{matrix.name}}
165109 run : |
166- cp firmware.uf2 $RELEASE_FILE.uf2
110+ source $BUILD_TOOLS
111+ cmake_build
167112
168113 - name : Store .uf2 as artifact
169114 uses : actions/upload-artifact@v3
170115 with :
171- name : ${{env.RELEASE_FILE}}.uf2
172- path : micropython/ports/rp2/ build-${{matrix.name}}/${{env.RELEASE_FILE}}.uf2
116+ name : ${{ env.RELEASE_FILE }}.uf2
117+ path : build-${{ matrix.name }}/${{ env.RELEASE_FILE }}.uf2
173118
174119 - name : Upload .uf2
175120 if : github.event_name == 'release'
176121 uses : actions/upload-release-asset@v1
177122 env :
178- GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
123+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
179124 with :
180- asset_path : micropython/ports/rp2/ build-${{matrix.name}}/firmware.uf2
181- upload_url : ${{github.event.release.upload_url}}
182- asset_name : ${{env.RELEASE_FILE}}.uf2
125+ asset_path : build-${{ matrix.name }}/firmware.uf2
126+ upload_url : ${{ github.event.release.upload_url }}
127+ asset_name : ${{ env.RELEASE_FILE }}.uf2
183128 asset_content_type : application/octet-stream
0 commit comments