diff --git a/.github/workflows/filesystem.yml b/.github/workflows/filesystem.yml new file mode 100644 index 0000000..1367524 --- /dev/null +++ b/.github/workflows/filesystem.yml @@ -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 diff --git a/.github/workflows/micropython.yml b/.github/workflows/micropython.yml index 54cc91e..2f920eb 100644 --- a/.github/workflows/micropython.yml +++ b/.github/workflows/micropython.yml @@ -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 @@ -115,7 +115,7 @@ 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" @@ -123,12 +123,15 @@ jobs: 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 @@ -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: | diff --git a/.github/workflows/python-linting.yml b/.github/workflows/python-linting.yml index a150116..68c216a 100644 --- a/.github/workflows/python-linting.yml +++ b/.github/workflows/python-linting.yml @@ -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 diff --git a/boards/PIMORONI_TINYFX/lib/README.md b/boards/PIMORONI_TINYFX/frozen_libs/README.md similarity index 100% rename from boards/PIMORONI_TINYFX/lib/README.md rename to boards/PIMORONI_TINYFX/frozen_libs/README.md diff --git a/boards/PIMORONI_TINYFX/lib/boot.py b/boards/PIMORONI_TINYFX/frozen_libs/boot.py similarity index 100% rename from boards/PIMORONI_TINYFX/lib/boot.py rename to boards/PIMORONI_TINYFX/frozen_libs/boot.py diff --git a/boards/PIMORONI_TINYFX/lib/pimoroni.py b/boards/PIMORONI_TINYFX/frozen_libs/pimoroni.py similarity index 100% rename from boards/PIMORONI_TINYFX/lib/pimoroni.py rename to boards/PIMORONI_TINYFX/frozen_libs/pimoroni.py diff --git a/boards/PIMORONI_TINYFX/manifest.py b/boards/PIMORONI_TINYFX/manifest.py index d77e74b..b1ea128 100644 --- a/boards/PIMORONI_TINYFX/manifest.py +++ b/boards/PIMORONI_TINYFX/manifest.py @@ -1,5 +1,6 @@ include("$(PORT_DIR)/boards/manifest.py") -freeze("lib/") +freeze("frozen_libs/") -freeze("../../picofx") \ No newline at end of file +# TODO: Convince Chris this is the one true and holy path +# package("picofx", base_path="../../") \ No newline at end of file diff --git a/examples/tiny_fx/effects/traffic_light.py b/examples/tiny_fx/examples/effects/traffic_light.py similarity index 100% rename from examples/tiny_fx/effects/traffic_light.py rename to examples/tiny_fx/examples/effects/traffic_light.py diff --git a/examples/tiny_fx/effects/wave.py b/examples/tiny_fx/examples/effects/wave.py similarity index 100% rename from examples/tiny_fx/effects/wave.py rename to examples/tiny_fx/examples/effects/wave.py diff --git a/examples/tiny_fx/showcase/ship_thrusters.py b/examples/tiny_fx/examples/showcase/ship_thrusters.py similarity index 100% rename from examples/tiny_fx/showcase/ship_thrusters.py rename to examples/tiny_fx/examples/showcase/ship_thrusters.py diff --git a/examples/tiny_fx/showcase/space_tales.py b/examples/tiny_fx/examples/showcase/space_tales.py similarity index 100% rename from examples/tiny_fx/showcase/space_tales.py rename to examples/tiny_fx/examples/showcase/space_tales.py diff --git a/examples/tiny_fx/showcase/space_tales_with_pir.py b/examples/tiny_fx/examples/showcase/space_tales_with_pir.py similarity index 100% rename from examples/tiny_fx/showcase/space_tales_with_pir.py rename to examples/tiny_fx/examples/showcase/space_tales_with_pir.py diff --git a/boards/PIMORONI_TINYFX/lib/audio.py b/examples/tiny_fx/lib/audio.py similarity index 100% rename from boards/PIMORONI_TINYFX/lib/audio.py rename to examples/tiny_fx/lib/audio.py diff --git a/boards/PIMORONI_TINYFX/lib/tiny_fx.py b/examples/tiny_fx/lib/tiny_fx.py similarity index 100% rename from boards/PIMORONI_TINYFX/lib/tiny_fx.py rename to examples/tiny_fx/lib/tiny_fx.py diff --git a/examples/tiny_fx/uf2-manifest.txt b/examples/tiny_fx/uf2-manifest.txt index 11a5d8e..5f55736 100644 --- a/examples/tiny_fx/uf2-manifest.txt +++ b/examples/tiny_fx/uf2-manifest.txt @@ -1 +1,8 @@ -main.py \ No newline at end of file +main.py +examples/*.py +examples/effects/*.py +examples/showcase/*.py +lib/*.py +lib/picofx/*.py +lib/picofx/colour/*.py +lib/picofx/mono/*.py \ No newline at end of file