Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Rely less on GitHub actions workflows. #55

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
92d1df9
CI: Rely less on GitHub actions workflows.
Gadgetoid Feb 8, 2025
73d0dc8
Add backported wireless patch.
Gadgetoid Feb 8, 2025
3af4c6e
CI: Bump to rebased MicroPython.
Gadgetoid Feb 8, 2025
0d6eb80
Squash debug output.
Gadgetoid Feb 14, 2025
8f2d594
Add PSRAM IO driver.
Gadgetoid Feb 17, 2025
a2cace3
PSRAM: Implement other ioctls for completeness.
Gadgetoid Feb 17, 2025
ed14c5b
PSRAM: Remove all BytesIO cruft.
Gadgetoid Feb 17, 2025
ee29533
PSRAM: Implement sync to flush XIP cache.
Gadgetoid Feb 17, 2025
02360b1
PSRAM: Better PSRAM cache flush.
Gadgetoid Feb 17, 2025
efd0bca
PSRAM: Switch to a concurrency safe cache clean.
Gadgetoid Feb 17, 2025
168990c
PSRAM: Add invalidate.
Gadgetoid Feb 17, 2025
805ff10
PSRAM: Revert to maybe working version.
Gadgetoid Feb 17, 2025
ec0f7d9
CI: Add pendsv build patch from upstream.
Gadgetoid Feb 18, 2025
bac1704
CI: Drop backport patches, fetch Pico SDK 2.1.1.
Gadgetoid Feb 19, 2025
b7c8435
Add launcher.
thirdr Feb 25, 2025
9ac9dd1
Update examples manifest.
Gadgetoid Feb 25, 2025
2be3d55
CI: Move backport tomfoolery to MicroPython branch.
Gadgetoid Feb 25, 2025
0cbf73d
Delete spurious two point path.
Gadgetoid Feb 25, 2025
58ff9f3
CI: Update LittleFS directory.
Gadgetoid Feb 25, 2025
8cf181f
main.py: clear the screen before reset
thirdr Feb 26, 2025
9d842f1
agile_pricing_display.py: network error handling
thirdr Feb 26, 2025
a208e7d
agile_pricing_display.py: handling of 'secrets.py' related errors
thirdr Feb 26, 2025
91da363
cheerlights_bulb.py: network error handling
thirdr Feb 26, 2025
6b995bc
random_maze.py: display qwstpad errors
thirdr Feb 26, 2025
dd69f45
random_maze.py: keep the 'disconnected' error on screen
thirdr Feb 26, 2025
e3777b3
word_clock.py: handling of 'secrets.py' related errors
thirdr Feb 26, 2025
3ca85dc
word_clock.py: handle failure to get time from ntptime
thirdr Feb 26, 2025
6a612f2
image_gallery.py: default to built in gallery when SD card is not pre…
thirdr Feb 27, 2025
126c4ed
adding default images for image_gallery.py
thirdr Feb 27, 2025
b0899ac
adding 'gallery' folder to the build
thirdr Feb 27, 2025
1f26bf7
Removing 'backlight.py'
thirdr Feb 27, 2025
18a9809
Adding qwstpad lib to build
thirdr Feb 27, 2025
cccc598
presto.py: removing unused import
thirdr Feb 27, 2025
557e0bd
vector_clock_full.py: adding header
thirdr Feb 27, 2025
c8ffa11
include 'secrets.py' in build
thirdr Feb 27, 2025
5b78ae1
stop_watch.py: visual changes
thirdr Feb 27, 2025
be39d59
removed '*.jpg' from manifest.txt
thirdr Feb 27, 2025
54a4dce
tomato.py: centre button
thirdr Feb 28, 2025
bd0b821
Correct default I2C pins.
Gadgetoid Feb 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 32 additions & 94 deletions .github/workflows/micropython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,28 @@ on:
release:
types: [created]

env:
MICROPYTHON_VERSION: feature/presto-wireless
MICROPYTHON_FLAVOUR: pimoroni
PIMORONI_PICO_VERSION: feature/picovector2-and-layers

jobs:
build:
name: ${{ matrix.name }} (${{ matrix.board }} ${{ matrix.variant }} ${{ matrix.modules }})
runs-on: ubuntu-latest
name: MicroPython ${{ matrix.name }}
runs-on: ubuntu-24.04
continue-on-error: true
strategy:
matrix:
include:
- name: presto
board: presto
variant:
modules: default

env:
# MicroPython version will be contained in github.event.release.tag_name for releases
RELEASE_FILE: ${{ matrix.name }}-${{ github.event.release.tag_name || github.sha }}-micropython
PIMORONI_PICO_DIR: "${{ github.workspace }}/pimoroni-pico"
USER_C_MODULES: "${{ github.workspace }}/src-${{ github.sha }}/modules/${{ matrix.modules }}.cmake"
USER_FS_MANIFEST: "${{ github.workspace }}/src-${{ github.sha }}/modules/${{ matrix.modules }}.txt"
USER_FS_SOURCE: "${{ github.workspace }}/src-${{ github.sha }}/examples"
TAG_OR_SHA: ${{ github.event.release.tag_name || github.sha }}
MICROPY_BOARD: ${{ matrix.board }}
MICROPY_BOARD_VARIANT: ${{ matrix.variant }}
MICROPY_BOARD_DIR: "${{ github.workspace }}/src-${{ github.sha }}/${{ matrix.BOARD }}"
MICROPY_FROZEN_MANIFEST: "${{ github.workspace }}/src-${{ github.sha }}/modules/${{ matrix.modules }}.py"
BOARD_NAME: ${{ matrix.name }}
BUILD_TOOLS: src-${{ github.sha }}/ci/micropython.sh
CI_PROJECT_ROOT: ${{ github.workspace }}/src-${{ github.sha }}
CI_BUILD_ROOT: ${{ github.workspace }}
CI_USE_ENV: 1

steps:
- name: Compiler Cache Fixup
run: |
mkdir -p /home/runner/.ccache

- name: "CCache: Restore saved cache"
uses: actions/cache@v4
with:
Expand All @@ -53,108 +37,62 @@ jobs:
ccache-micropython-${{ matrix.name }}-${{ github.ref }}
ccache-micropython-${{ matrix.name }}-

- name: "Src: Checkout"
uses: actions/checkout@v4
with:
submodules: true
path: src-${{ github.sha }}

- name: "Pimoroni Pico: Checkout"
- name: "Checkout Project"
uses: actions/checkout@v4
with:
repository: pimoroni/pimoroni-pico
ref: ${{env.PIMORONI_PICO_VERSION}}
submodules: true
path: pimoroni-pico
path: ${{ env.CI_PROJECT_ROOT }}

- name: Install Arm GNU Toolchain (arm-none-eabi-gcc)
- name: "Install Arm GNU Toolchain (arm-none-eabi-gcc)"
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '13.3.Rel1'

- name: "CCache: Install"
run: |
source $BUILD_TOOLS
apt_install_build_deps

- name: "MicroPython: Checkout"
run: |
source $BUILD_TOOLS
micropython_clone

- name: "Py_Decl: Checkout"
uses: actions/checkout@v4
with:
repository: gadgetoid/py_decl
ref: v0.0.4
path: py_decl

- name: "dir2uf2: Checkout"
uses: actions/checkout@v4
with:
repository: gadgetoid/dir2uf2
ref: v0.0.10
path: dir2uf2

- name: "MicroPython: Build MPY Cross"
- name: "Prepare tools & dependencies"
shell: bash
run: |
source $BUILD_TOOLS
micropython_build_mpy_cross
source $CI_PROJECT_ROOT/ci/micropython.sh && ci_debug
mkdir -p $CI_BUILD_ROOT
ci_apt_install_build_deps
ci_prepare_all

- name: "MicroPython: Configure"
shell: bash
run: |
source $BUILD_TOOLS
source $CI_PROJECT_ROOT/ci/micropython.sh && ci_debug
micropython_version
cmake_configure
ci_cmake_configure ${{ matrix.name }}

- name: "MicroPython: Build"
shell: bash
run: |
source $BUILD_TOOLS
cmake_build

- name: "Py_Decl: Verify .uf2"
shell: bash
run: |
python3 py_decl/py_decl.py --to-json --verify build-${{ matrix.name }}/${{ env.RELEASE_FILE }}.uf2

- name: "dir2uf2: Append filesystem to .uf2"
shell: bash
run: |
python3 -m pip install littlefs-python==0.12.0
./dir2uf2/dir2uf2 --fs-compact --append-to build-${{ matrix.name }}/${{ env.RELEASE_FILE }}.uf2 --manifest ${{env.USER_FS_MANIFEST}} --filename with-filesystem.uf2 ${{env.USER_FS_SOURCE}}/
source $CI_PROJECT_ROOT/ci/micropython.sh && ci_debug
python3 -m venv "$CI_BUILD_ROOT/.dir2uf2"
source "$CI_BUILD_ROOT/.dir2uf2/bin/activate"
ci_cmake_build ${{ matrix.name }}
mv "$CI_BUILD_ROOT/${{ matrix.name }}.uf2" "$CI_BUILD_ROOT/$RELEASE_FILE.uf2"
mv "$CI_BUILD_ROOT/${{ matrix.name }}-with-filesystem.uf2" "$CI_BUILD_ROOT/$RELEASE_FILE-with-filesystem.uf2"

- name: "Artifacts: Upload .uf2"
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_FILE }}.uf2
path: build-${{ matrix.name }}/${{ env.RELEASE_FILE }}.uf2

- name: "Artifacts: Upload .uf2 with filesystem"
path: ${{ env.CI_BUILD_ROOT }}/${{ env.RELEASE_FILE }}.uf2
- name: "Artifacts: Upload .uf2 (With Filesystem)"
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_FILE }}-with-filesystem.uf2
path: ${{ env.RELEASE_FILE }}-with-filesystem.uf2
path: ${{ env.CI_BUILD_ROOT }}/${{ env.RELEASE_FILE }}-with-filesystem.uf2

- name: "Release: Upload .uf2"
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v1
with:
asset_path: build-${{ matrix.name }}/${{ env.RELEASE_FILE }}.uf2
upload_url: ${{ github.event.release.upload_url }}
asset_name: ${{ env.RELEASE_FILE }}.uf2
asset_content_type: application/octet-stream
files: ${{ env.CI_BUILD_ROOT }}/${{ env.RELEASE_FILE }}.uf2

- name: "Release: Upload .uf2 with filesystem"
- name: "Release: Upload .uf2 (With Filesystem)"
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v1
with:
asset_path: ${{ env.RELEASE_FILE }}-with-filesystem.uf2
upload_url: ${{ github.event.release.upload_url }}
asset_name: ${{ env.RELEASE_FILE }}-with-filesystem.uf2
asset_content_type: application/octet-stream
files: ${{ env.CI_BUILD_ROOT }}/${{ env.RELEASE_FILE }}-with-filesystem.uf2
37 changes: 37 additions & 0 deletions boards/common.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Make sure we get our VirtualEnv Python
set(Python_FIND_VIRTUALENV "FIRST")
set(Python_FIND_UNVERSIONED_NAMES "FIRST")
set(Python_FIND_STRATEGY "LOCATION")
find_package (Python COMPONENTS Interpreter Development)

message("dir2uf2/py_decl: Using Python ${Python_EXECUTABLE}")
MESSAGE("dir2uf2/py_decl: Using pimoroni tools dir ${PIMORONI_TOOLS_DIR}")

# Convert supplies paths to absolute, for a quieter life
get_filename_component(PIMORONI_UF2_MANIFEST ${PIMORONI_UF2_MANIFEST} REALPATH)
get_filename_component(PIMORONI_UF2_DIR ${PIMORONI_UF2_DIR} REALPATH)

if (EXISTS "${PIMORONI_TOOLS_DIR}/py_decl/py_decl.py")
MESSAGE("py_decl: py_decl.py found, will verify uf2.")
add_custom_target("${MICROPY_TARGET}-verify" ALL
COMMAND ${Python_EXECUTABLE} "${PIMORONI_TOOLS_DIR}/py_decl/py_decl.py" --to-json --verify "${CMAKE_CURRENT_BINARY_DIR}/${MICROPY_TARGET}.uf2"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "pydecl: Verifying ${MICROPY_TARGET}.uf2"
DEPENDS ${MICROPY_TARGET}
)
endif()

if (EXISTS "${PIMORONI_TOOLS_DIR}/dir2uf2/dir2uf2" AND EXISTS "${PIMORONI_UF2_MANIFEST}" AND EXISTS "${PIMORONI_UF2_DIR}")
MESSAGE("dir2uf2: Using manifest ${PIMORONI_UF2_MANIFEST}.")
MESSAGE("dir2uf2: Using root ${PIMORONI_UF2_DIR}.")
add_custom_target("${MICROPY_TARGET}-with-filesystem.uf2" ALL
COMMAND ${Python_EXECUTABLE} "${PIMORONI_TOOLS_DIR}/dir2uf2/dir2uf2" --fs-compact --sparse --append-to "${MICROPY_TARGET}.uf2" --manifest "${PIMORONI_UF2_MANIFEST}" --filename with-filesystem.uf2 "${PIMORONI_UF2_DIR}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "dir2uf2: Appending filesystem to ${MICROPY_TARGET}.uf2."
DEPENDS ${MICROPY_TARGET}
DEPENDS "${MICROPY_TARGET}-verify"
)
else()
MESSAGE("dir2uf2: Could not find manifest ${PIMORONI_UF2_MANIFEST}")
MESSAGE(" and/or root ${PIMORONI_UF2_DIR}.")
endif()
2 changes: 1 addition & 1 deletion modules/default.py → boards/manifest-common.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
include("$(BOARD_DIR)/manifest.py")

# Include pga/modules/py_frozen
freeze("py_frozen/")
freeze("../modules/py_frozen/")
2 changes: 2 additions & 0 deletions boards/presto/manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include("$(PORT_DIR)/boards/manifest.py")
include("../manifest-common.py")
13 changes: 13 additions & 0 deletions boards/presto/manifest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
*.af
*.png
main.py
cheerlights_bulb.py
cubes.py
image_gallery.py
random_maze.py
secrets.py
stop_watch.py
tomato.py
vector_clock_full.py
word_clock.py
gallery/*.jpg
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ set(MICROPY_BLUETOOTH_BTSTACK ON)
# MICROPY_PY_BLUETOOTH_CYW43 = 1
set(MICROPY_PY_BLUETOOTH_CYW43 ON)

set(MICROPY_HW_ENABLE_PSRAM ON)
set(MICROPY_HW_ENABLE_PSRAM ON)

# Board specific version of the frozen manifest
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)

set(PIMORONI_UF2_MANIFEST ${MICROPY_BOARD_DIR}/manifest.txt)
set(PIMORONI_UF2_DIR ${CMAKE_CURRENT_LIST_DIR}/../../examples)
include(${CMAKE_CURRENT_LIST_DIR}/../common.cmake)
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions presto/presto.h → boards/presto/presto.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 4
#define PICO_DEFAULT_I2C_SDA_PIN 40
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 5
#define PICO_DEFAULT_I2C_SCL_PIN 41
#endif

// --- SPI ---
Expand Down
3 changes: 3 additions & 0 deletions boards/presto/usermodules.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../")

include(usermod-common)
11 changes: 6 additions & 5 deletions modules/default.cmake → boards/usermod-common.cmake
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
if(NOT DEFINED PIMORONI_PICO_PATH)
set(PIMORONI_PICO_PATH ../pimoroni-pico)
set(PIMORONI_PICO_PATH ${CMAKE_CURRENT_LIST_DIR}/../pimoroni-pico)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/../pimoroni_pico_import.cmake)
include(${PIMORONI_PICO_PATH}/pimoroni_pico_import.cmake)

include_directories(${CMAKE_CURRENT_LIST_DIR}/..)
include_directories(${PIMORONI_PICO_PATH}/micropython)

list(APPEND CMAKE_MODULE_PATH "${PIMORONI_PICO_PATH}/micropython")
list(APPEND CMAKE_MODULE_PATH "${PIMORONI_PICO_PATH}/micropython/modules")

# Allows us to find /pga/modules/c/<module>/micropython
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
# Allows us to find /modules/c/<module>/micropython
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/..")

set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

include(c/presto/micropython)
include(modules/c/presto/micropython)

# Essential
include(pimoroni_i2c/micropython)
Expand Down
Loading