7
7
types : [created]
8
8
9
9
env :
10
- MICROPYTHON_VERSION : v1.21.0
11
- WORKFLOW_VERSION : v1
10
+ MICROPYTHON_VERSION : v1.22.1
12
11
13
12
jobs :
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
-
64
13
build :
65
- needs : deps
66
- name : ${{matrix.name}} (${{matrix.board}})
14
+ name : ${{ matrix.name }} (${{ matrix.board }})
67
15
runs-on : ubuntu-20.04
68
16
strategy :
69
17
matrix :
82
30
board : PIMORONI_TUFTY2040
83
31
- name : enviro
84
32
board : PICO_W_ENVIRO
85
- patch : true
86
33
- name : galactic_unicorn
87
34
board : RPI_PICO_W
88
35
- name : cosmic_unicorn
@@ -91,93 +38,91 @@ jobs:
91
38
board : RPI_PICO_W
92
39
- name : inky_frame
93
40
board : PICO_W_INKY
94
- patch : true
95
41
96
42
env :
97
43
# 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
101
52
102
53
steps :
103
54
- name : Compiler Cache
104
55
uses : actions/cache@v3
105
56
with :
106
57
path : /home/runner/.ccache
107
- key : ccache-micropython-${{matrix.name}}-${{github.ref}}-${{github.sha}}
58
+ key : ccache-micropython-${{ matrix.name }}-${{ github.ref }}-${{ github.sha }}
108
59
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 }}-
119
62
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
126
64
with :
127
65
submodules : true
128
66
path : pimoroni-pico-${{ github.sha }}
129
67
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
132
74
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
135
87
136
88
- name : " HACK: CMakeLists.txt Disable C++ Exceptions Patch"
137
89
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
140
93
141
94
- name : " HACK: Pico SDK Patch"
142
- if : matrix.patch == true
143
95
shell : bash
144
- working-directory : micropython
145
96
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
147
99
148
100
- name : Configure MicroPython
149
101
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
157
102
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
161
106
162
- - name : Rename .uf2 for artifact
107
+ - name : Build MicroPython
163
108
shell : bash
164
- working-directory : micropython/ports/rp2/build-${{matrix.name}}
165
109
run : |
166
- cp firmware.uf2 $RELEASE_FILE.uf2
110
+ source $BUILD_TOOLS
111
+ cmake_build
167
112
168
113
- name : Store .uf2 as artifact
169
114
uses : actions/upload-artifact@v3
170
115
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
173
118
174
119
- name : Upload .uf2
175
120
if : github.event_name == 'release'
176
121
uses : actions/upload-release-asset@v1
177
122
env :
178
- GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
123
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
179
124
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
183
128
asset_content_type : application/octet-stream
0 commit comments