19
19
uses : actions/cache@v3
20
20
with :
21
21
path : ${{runner.workspace}}
22
- key : workspace-micropython-${{env.MICROPYTHON_VERSION}}
22
+ key : workspace-micropython-${{env.MICROPYTHON_VERSION}}-with-libs
23
23
restore-keys : |
24
- workspace-micropython-${{env.MICROPYTHON_VERSION}}
24
+ workspace-micropython-${{env.MICROPYTHON_VERSION}}-with-libs
25
25
26
26
# Check out MicroPython
27
27
- name : Checkout MicroPython
33
33
submodules : false # MicroPython submodules are hideously broken
34
34
path : micropython
35
35
36
+ # Check out MicroPython Libs
37
+ - name : Checkout MicroPython Libs
38
+ if : steps.cache.outputs.cache-hit != 'true'
39
+ uses : actions/checkout@v3
40
+ with :
41
+ repository : micropython/micropython-lib
42
+ path : micropython-lib
43
+
36
44
- name : Fetch base MicroPython submodules
37
45
if : steps.cache.outputs.cache-hit != 'true'
38
46
shell : bash
@@ -53,13 +61,15 @@ jobs:
53
61
54
62
build :
55
63
needs : deps
56
- name : Build ${{matrix.board}}
64
+ name : ${{matrix.name}} ( ${{matrix.board}})
57
65
runs-on : ubuntu-20.04
58
66
strategy :
59
67
matrix :
60
68
include :
61
69
- name : pico
62
70
board : PICO
71
+ - name : picow
72
+ board : PICO_W
63
73
- name : tiny2040
64
74
board : PIMORONI_TINY2040
65
75
- name : picolipo_4mb
@@ -68,10 +78,25 @@ jobs:
68
78
board : PIMORONI_PICOLIPO_16MB
69
79
- name : tufty2040
70
80
board : PIMORONI_TUFTY2040
81
+ local_board_dir : true
82
+ - name : enviro
83
+ board : PICO_W_ENVIRO
84
+ local_board_dir : true
85
+ patch : true
86
+ - name : galactic_unicorn
87
+ board : PICO_W
88
+ - name : cosmic_unicorn
89
+ board : PICO_W
90
+ - name : inky_frame
91
+ board : PICO_W_INKY
92
+ local_board_dir : true
93
+ patch : true
71
94
72
95
env :
73
96
# MicroPython version will be contained in github.event.release.tag_name for releases
74
- RELEASE_FILE : pimoroni-${{matrix.name}}-${{github.event.release.tag_name || github.sha}}-micropython.uf2
97
+ RELEASE_FILE : pimoroni-${{matrix.name}}-${{github.event.release.tag_name || github.sha}}-micropython
98
+ MICROPY_BOARD_DIR : " $GITHUB_WORKSPACE/pimoroni-pico-${{ github.sha }}/micropython/board/${{ matrix.BOARD }}"
99
+ USER_C_MODULES : " $GITHUB_WORKSPACE/pimoroni-pico-${{ github.sha }}/micropython/modules/micropython-${{matrix.name}}.cmake"
75
100
76
101
steps :
77
102
- name : Compiler Cache
@@ -101,18 +126,27 @@ jobs:
101
126
submodules : true
102
127
path : pimoroni-pico-${{ github.sha }}
103
128
104
- - name : " HACK: MicroPython Board Fixups"
129
+ - name : " HACK: Pico SDK Patch"
130
+ if : matrix.patch == true
105
131
shell : bash
106
- working-directory : micropython/ports/rp2
132
+ working-directory : micropython
107
133
run : |
108
- ../../../ pimoroni-pico-${GITHUB_SHA} /micropython/_board/ board-fixup .sh ${{matrix.name}} ${{matrix. board}} ../../../pimoroni-pico-${GITHUB_SHA}/micropython/_board
134
+ $GITHUB_WORKSPACE/ pimoroni-pico-${{ github.sha }} /micropython/board/pico-sdk-patch .sh ${{matrix.board}}
109
135
110
- - name : Configure MicroPython
136
+ - name : Configure MicroPython (Local Board Dir)
137
+ if : matrix.local_board_dir == true
111
138
shell : bash
112
139
working-directory : micropython/ports/rp2
113
140
run : |
114
- cmake -S . -B build-${{matrix.board}} -DPICO_BUILD_DOCS=0 -DUSER_C_MODULES=../../../pimoroni-pico-${GITHUB_SHA}/micropython/modules/micropython-${{matrix.name}}.cmake -DMICROPY_BOARD=${{matrix.board}} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
115
-
141
+ cmake -S . -B build-${{matrix.board}} -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
142
+
143
+ - name : Configure MicroPython (Upstream Board Dir)
144
+ if : matrix.local_board_dir != true
145
+ shell : bash
146
+ working-directory : micropython/ports/rp2
147
+ run : |
148
+ cmake -S . -B build-${{matrix.board}} -DPICO_BUILD_DOCS=0 -DUSER_C_MODULES=${{env.USER_C_MODULES}} -DMICROPY_BOARD=${{matrix.board}} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
149
+
116
150
- name : Build MicroPython
117
151
shell : bash
118
152
working-directory : micropython/ports/rp2
@@ -124,13 +158,14 @@ jobs:
124
158
- name : Rename .uf2 for artifact
125
159
shell : bash
126
160
working-directory : micropython/ports/rp2/build-${{matrix.board}}
127
- run : cp firmware.uf2 $RELEASE_FILE
161
+ run : |
162
+ cp firmware.uf2 $RELEASE_FILE.uf2
128
163
129
164
- name : Store .uf2 as artifact
130
165
uses : actions/upload-artifact@v3
131
166
with :
132
- name : ${{env.RELEASE_FILE}}
133
- path : micropython/ports/rp2/build-${{matrix.board}}/${{env.RELEASE_FILE}}
167
+ name : ${{env.RELEASE_FILE}}.uf2
168
+ path : micropython/ports/rp2/build-${{matrix.board}}/${{env.RELEASE_FILE}}.uf2
134
169
135
170
- name : Upload .uf2
136
171
if : github.event_name == 'release'
@@ -140,5 +175,5 @@ jobs:
140
175
with :
141
176
asset_path : micropython/ports/rp2/build-${{matrix.board}}/firmware.uf2
142
177
upload_url : ${{github.event.release.upload_url}}
143
- asset_name : ${{env.RELEASE_FILE}}
178
+ asset_name : ${{env.RELEASE_FILE}}.uf2
144
179
asset_content_type : application/octet-stream
0 commit comments