Skip to content

Commit 40d4774

Browse files
authored
Merge pull request #737 from pimoroni/patch-cleanup-workflows
CI: Tidyup and combine MicroPython builds.
2 parents c9bee93 + 3a35013 commit 40d4774

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+76
-1067
lines changed

.github/workflows/micropython-picow.yml

Lines changed: 0 additions & 153 deletions
This file was deleted.

.github/workflows/micropython.yml

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ jobs:
1919
uses: actions/cache@v3
2020
with:
2121
path: ${{runner.workspace}}
22-
key: workspace-micropython-${{env.MICROPYTHON_VERSION}}
22+
key: workspace-micropython-${{env.MICROPYTHON_VERSION}}-with-libs
2323
restore-keys: |
24-
workspace-micropython-${{env.MICROPYTHON_VERSION}}
24+
workspace-micropython-${{env.MICROPYTHON_VERSION}}-with-libs
2525
2626
# Check out MicroPython
2727
- name: Checkout MicroPython
@@ -33,6 +33,14 @@ jobs:
3333
submodules: false # MicroPython submodules are hideously broken
3434
path: micropython
3535

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+
3644
- name: Fetch base MicroPython submodules
3745
if: steps.cache.outputs.cache-hit != 'true'
3846
shell: bash
@@ -53,13 +61,15 @@ jobs:
5361

5462
build:
5563
needs: deps
56-
name: Build ${{matrix.board}}
64+
name: ${{matrix.name}} (${{matrix.board}})
5765
runs-on: ubuntu-20.04
5866
strategy:
5967
matrix:
6068
include:
6169
- name: pico
6270
board: PICO
71+
- name: picow
72+
board: PICO_W
6373
- name: tiny2040
6474
board: PIMORONI_TINY2040
6575
- name: picolipo_4mb
@@ -68,10 +78,25 @@ jobs:
6878
board: PIMORONI_PICOLIPO_16MB
6979
- name: tufty2040
7080
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
7194

7295
env:
7396
# 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"
75100

76101
steps:
77102
- name: Compiler Cache
@@ -101,18 +126,27 @@ jobs:
101126
submodules: true
102127
path: pimoroni-pico-${{ github.sha }}
103128

104-
- name: "HACK: MicroPython Board Fixups"
129+
- name: "HACK: Pico SDK Patch"
130+
if: matrix.patch == true
105131
shell: bash
106-
working-directory: micropython/ports/rp2
132+
working-directory: micropython
107133
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}}
109135
110-
- name: Configure MicroPython
136+
- name: Configure MicroPython (Local Board Dir)
137+
if: matrix.local_board_dir == true
111138
shell: bash
112139
working-directory: micropython/ports/rp2
113140
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+
116150
- name: Build MicroPython
117151
shell: bash
118152
working-directory: micropython/ports/rp2
@@ -124,13 +158,14 @@ jobs:
124158
- name: Rename .uf2 for artifact
125159
shell: bash
126160
working-directory: micropython/ports/rp2/build-${{matrix.board}}
127-
run: cp firmware.uf2 $RELEASE_FILE
161+
run: |
162+
cp firmware.uf2 $RELEASE_FILE.uf2
128163
129164
- name: Store .uf2 as artifact
130165
uses: actions/upload-artifact@v3
131166
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
134169

135170
- name: Upload .uf2
136171
if: github.event_name == 'release'
@@ -140,5 +175,5 @@ jobs:
140175
with:
141176
asset_path: micropython/ports/rp2/build-${{matrix.board}}/firmware.uf2
142177
upload_url: ${{github.event.release.upload_url}}
143-
asset_name: ${{env.RELEASE_FILE}}
178+
asset_name: ${{env.RELEASE_FILE}}.uf2
144179
asset_content_type: application/octet-stream

micropython/_board/badger2040/PIMORONI_BADGER2040/board.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

micropython/_board/badger2040/PIMORONI_BADGER2040/mpconfigboard.cmake

Lines changed: 0 additions & 1 deletion
This file was deleted.

micropython/_board/badger2040/PIMORONI_BADGER2040/mpconfigboard.h

Lines changed: 0 additions & 3 deletions
This file was deleted.

micropython/_board/badger2040/fixup.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)