8
8
9
9
env :
10
10
MICROPYTHON_VERSION : v1.22.1
11
- WORKFLOW_VERSION : v1
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,81 @@ 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}}-
60
+ ccache-micropython-${{ matrix.name }}-${{ github.ref }}
61
+ ccache-micropython-${{ matrix.name }}-
111
62
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}}
119
-
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
-
130
- - name : Set MicroPython Version Env Vars
131
- shell : bash
67
+
68
+ - name : Install Compiler & CCache
132
69
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
70
+ source $BUILD_TOOLS
71
+ build_deps
72
+
73
+ - name : Checkout MicroPython & MicroPython Libs
74
+ run : |
75
+ source $BUILD_TOOLS
76
+ clone_micropython_lib
77
+ clone_micropython
135
78
136
79
- name : " HACK: CMakeLists.txt Disable C++ Exceptions Patch"
137
80
shell : bash
138
- working-directory : micropython
139
- run : git apply $GITHUB_WORKSPACE/pimoroni-pico-${{ github.sha }}/micropython/micropython_nano_specs.patch
81
+ run : |
82
+ source $BUILD_TOOLS
83
+ hack_patch_micropython_disable_exceptions
140
84
141
85
- name : " HACK: Pico SDK Patch"
142
- if : matrix.patch == true
143
86
shell : bash
144
- working-directory : micropython
145
87
run : |
146
- $GITHUB_WORKSPACE/pimoroni-pico-${{ github.sha }}/micropython/board/pico-sdk-patch.sh ${{matrix.board}}
88
+ source $BUILD_TOOLS
89
+ hack_patch_pico_sdk
147
90
148
91
- name : Configure MicroPython
149
92
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
93
run : |
158
- ccache --zero-stats || true
159
- cmake --build build-${{matrix.name}} -j 1
160
- ccache --show-stats || true
94
+ source $BUILD_TOOLS
95
+ cmake_configure
161
96
162
- - name : Rename .uf2 for artifact
97
+ - name : Build MicroPython
163
98
shell : bash
164
- working-directory : micropython/ports/rp2/build-${{matrix.name}}
165
99
run : |
166
- cp firmware.uf2 $RELEASE_FILE.uf2
100
+ source $BUILD_TOOLS
101
+ cmake_build
167
102
168
103
- name : Store .uf2 as artifact
169
104
uses : actions/upload-artifact@v3
170
105
with :
171
- name : ${{env.RELEASE_FILE}}.uf2
172
- path : micropython/ports/rp2/ build-${{matrix.name}}/${{env.RELEASE_FILE}}.uf2
106
+ name : ${{ env.RELEASE_FILE }}.uf2
107
+ path : build-${{ matrix.name }}/${{ env.RELEASE_FILE }}.uf2
173
108
174
109
- name : Upload .uf2
175
110
if : github.event_name == 'release'
176
111
uses : actions/upload-release-asset@v1
177
112
env :
178
- GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
113
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
179
114
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
115
+ asset_path : build-${{ matrix.name }}/firmware.uf2
116
+ upload_url : ${{ github.event.release.upload_url }}
117
+ asset_name : ${{ env.RELEASE_FILE }}.uf2
183
118
asset_content_type : application/octet-stream
0 commit comments