Merge pull request #473 from pimoroni/patch-badger2040-no-modules

Badger2040: Produce build without baked-in modules.
This commit is contained in:
Philip Howard 2022-07-27 12:29:23 +01:00 committed by GitHub
commit 86609b9047
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 47 additions and 6 deletions

View File

@ -10,7 +10,7 @@ env:
MICROPYTHON_VERSION: v1.19
BOARD_TYPE: PIMORONI_BADGER2040
# MicroPython version will be contained in github.event.release.tag_name for releases
RELEASE_FILE: pimoroni-badger2040-${{github.event.release.tag_name || github.sha}}-micropython.uf2
RELEASE_FILE: pimoroni-badger2040-${{github.event.release.tag_name || github.sha}}-micropython
jobs:
deps:
@ -95,6 +95,45 @@ jobs:
sudo apt update && sudo apt install ccache gcc-arm-none-eabi
python3 -m pip install pillow
# Build without BadgerOS
- name: Configure MicroPython (No BadgerOS)
shell: bash
working-directory: micropython/ports/rp2
run: |
cmake -S . -B build-${{env.BOARD_TYPE}} -DBADGER2040_NO_MODULES=1 -DPICO_BUILD_DOCS=0 -DUSER_C_MODULES=../../../pimoroni-pico-${GITHUB_SHA}/micropython/modules/badger2040-micropython.cmake -DMICROPY_BOARD=${{env.BOARD_TYPE}} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build MicroPython (No BadgerOS)
shell: bash
working-directory: micropython/ports/rp2
run: |
ccache --zero-stats || true
cmake --build build-${{env.BOARD_TYPE}} -j 2
ccache --show-stats || true
- name: Rename .uf2 for artifact (No BadgerOS)
shell: bash
working-directory: micropython/ports/rp2/build-${{env.BOARD_TYPE}}
run: |
cp firmware.uf2 ${{env.RELEASE_FILE}}-without-badger-os.uf2
- name: Store .uf2 as artifact (No BadgerOS)
uses: actions/upload-artifact@v2
with:
name: ${{env.RELEASE_FILE}}-without-badger-os.uf2
path: micropython/ports/rp2/build-${{env.BOARD_TYPE}}/${{env.RELEASE_FILE}}-without-badger-os.uf2
- name: Upload .uf2 (No BadgerOS)
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
asset_path: micropython/ports/rp2/build-${{env.BOARD_TYPE}}/${{env.RELEASE_FILE}}-without-badger-os.uf2
upload_url: ${{github.event.release.upload_url}}
asset_name: ${{env.RELEASE_FILE}}-without-badger-os.uf2
asset_content_type: application/octet-stream
# Build with BadgerOS
- name: Configure MicroPython
shell: bash
working-directory: micropython/ports/rp2
@ -113,13 +152,13 @@ jobs:
shell: bash
working-directory: micropython/ports/rp2/build-${{env.BOARD_TYPE}}
run: |
cp firmware.uf2 ${{env.RELEASE_FILE}}
cp firmware.uf2 ${{env.RELEASE_FILE}}.uf2
- name: Store .uf2 as artifact
uses: actions/upload-artifact@v2
with:
name: ${{env.RELEASE_FILE}}
path: micropython/ports/rp2/build-${{env.BOARD_TYPE}}/${{env.RELEASE_FILE}}
name: ${{env.RELEASE_FILE}}.uf2
path: micropython/ports/rp2/build-${{env.BOARD_TYPE}}/${{env.RELEASE_FILE}}.uf2
- name: Upload .uf2
if: github.event_name == 'release'
@ -127,7 +166,7 @@ jobs:
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
asset_path: micropython/ports/rp2/build-${{env.BOARD_TYPE}}/firmware.uf2
asset_path: micropython/ports/rp2/build-${{env.BOARD_TYPE}}/${{env.RELEASE_FILE}}.uf2
upload_url: ${{github.event.release.upload_url}}
asset_name: ${{env.RELEASE_FILE}}
asset_name: ${{env.RELEASE_FILE}}.uf2
asset_content_type: application/octet-stream

View File

@ -31,7 +31,9 @@ include(hershey_fonts/micropython)
include(bitmap_fonts/micropython)
include(badger2040/micropython)
if(NOT DEFINED BADGER2040_NO_MODULES)
include(micropython/examples/badger2040/micropython-builtins)
endif()
include(plasma/micropython)
include(ulab/code/micropython)
include(qrcode/micropython/micropython)