Skip to content

Commit

Permalink
Merge pull request #1 from pimoroni/patch-freeze-fix
Browse files Browse the repository at this point in the history
Include example and library files in user accessible filesystem
  • Loading branch information
ZodiusInfuser authored Jul 29, 2024
2 parents 6dc4aa3 + 68c021f commit 243dd56
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 15 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/filesystem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Zip Files

on:
push:
pull_request:
release:
types: [created]

jobs:
build:
name: Build ${{matrix.name}}
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- name: TinyFX
shortname: tiny_fx
board: PIMORONI_TINYFX

env:
RELEASE_FILE: ${{matrix.shortname}}-${{github.event.release.tag_name || github.sha}}

steps:
- uses: actions/checkout@v4
with:
submodules: true
path: picofx

- name: Libs .zip artifact
uses: actions/upload-artifact@v4
with:
name: ${{env.RELEASE_FILE}}-libs-only
path: picofx/picofx

- name: Examples .zip artifact
uses: actions/upload-artifact@v4
with:
name: ${{env.RELEASE_FILE}}-examples-only
path: "picofx/examples/${{matrix.shortname}}"

- name: Libs .zip release asset
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
asset_path: picofx/picofx
upload_url: ${{github.event.release.upload_url}}
asset_name: ${{env.RELEASE_FILE}}-libs-only
asset_content_type: application/octet-stream

- name: Examples .zip release asset
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
asset_path: "picofx/examples/${{matrix.shortname}}"
upload_url: ${{github.event.release.upload_url}}
asset_name: ${{env.RELEASE_FILE}}-examples-only
asset_content_type: application/octet-stream
29 changes: 19 additions & 10 deletions .github/workflows/micropython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ jobs:
matrix:
include:
- name: TinyFX
shortname: tinyfx
shortundername: tiny_fx
shortname: tiny_fx
board: PIMORONI_TINYFX

env:
RELEASE_FILE: pimoroni-${{matrix.shortname}}-${{github.event.release.tag_name || github.sha}}-micropython.uf2
RELEASE_FILE_WITH_OS: pimoroni-${{matrix.shortname}}-${{github.event.release.tag_name || github.sha}}-micropython-with-examples.uf2
FIRMWARE_DIR: "$GITHUB_WORKSPACE/picofx/boards"
ROOT_DIR: "$GITHUB_WORKSPACE/picofx"
BOARD_DIR: "$GITHUB_WORKSPACE/picofx/boards/${{matrix.board}}"
EXAMPLES_DIR: "$GITHUB_WORKSPACE/picofx/examples/${{matrix.shortundername}}"
EXAMPLES_DIR: "$GITHUB_WORKSPACE/picofx/examples/${{matrix.shortname}}"

steps:
- name: Compiler Cache
Expand Down Expand Up @@ -115,20 +115,23 @@ jobs:
- uses: actions/checkout@v4
with:
repository: gadgetoid/dir2uf2
ref: v0.0.5
ref: v0.0.6
path: dir2uf2

- name: "HACK: MicroPython out of tree board pins.csv patch"
shell: bash
working-directory: micropython
run: |
git apply "${{env.FIRMWARE_DIR}}/932f76c6ba64c5a3e68de3324556d9979f09303b.patch"
# Install apt packages
- name: Install CCache & Compiler
shell: bash
run:
sudo apt update && sudo apt install ccache gcc-arm-none-eabi
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc)
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '9-2020-q2'

- name: Install CCache
run: |
sudo apt update && sudo apt install ccache
# Build firmware
- name: Configure MicroPython
Expand Down Expand Up @@ -156,6 +159,12 @@ jobs:
run: |
python3 py_decl/py_decl.py --to-json --verify micropython/ports/rp2/build/${{ env.RELEASE_FILE }}
- name: "HACK: Mangle PicoFX Lib into user filesystem"
shell: bash
run: |
mkdir -p ${{env.EXAMPLES_DIR}}/lib
cp -v -r ${{env.ROOT_DIR}}/picofx ${{env.EXAMPLES_DIR}}/lib
- name: Append Filesystem
shell: bash
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
python3 -m flake8 --show-source --ignore E501 examples
- name: Lint TinyFX Libs
- name: Lint Frozen Libs
shell: bash
run: |
python3 -m flake8 --show-source --ignore E501 boards/PIMORONI_TINYFX/lib
python3 -m flake8 --show-source --ignore E501 boards/*/frozen_libs
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions boards/PIMORONI_TINYFX/manifest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include("$(PORT_DIR)/boards/manifest.py")

freeze("lib/")
freeze("frozen_libs/")

freeze("../../picofx")
# TODO: Convince Chris this is the one true and holy path
# package("picofx", base_path="../../")
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 8 additions & 1 deletion examples/tiny_fx/uf2-manifest.txt
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
main.py
main.py
examples/*.py
examples/effects/*.py
examples/showcase/*.py
lib/*.py
lib/picofx/*.py
lib/picofx/colour/*.py
lib/picofx/mono/*.py

0 comments on commit 243dd56

Please sign in to comment.