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

Include example and library files in user accessible filesystem #1

Merged
merged 8 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
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.
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