Merge pull request #43 from pimoroni/patch-pimoroni-pico #293
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: MicroPython | |
| on: | |
| push: | |
| pull_request: | |
| release: | |
| types: [created] | |
| jobs: | |
| build: | |
| name: MicroPython ${{ matrix.name }} | |
| runs-on: ubuntu-24.04 | |
| continue-on-error: true | |
| strategy: | |
| matrix: | |
| include: | |
| - name: rpi_pico2 | |
| - name: rpi_pico2_w | |
| - name: rpi_pico2b | |
| - name: pimoroni_plasma2350 | |
| - name: pimoroni_tiny2350 | |
| - name: pimoroni_pico_plus2 | |
| env: | |
| # MicroPython version will be contained in github.event.release.tag_name for releases | |
| CI_RELEASE_FILENAME: ${{ matrix.name }}-${{ github.event.release.tag_name || github.sha }}-micropython | |
| 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: | |
| path: /home/runner/.ccache | |
| key: ccache-micropython-${{ matrix.name }}-${{ github.ref }}-${{ github.sha }} | |
| restore-keys: | | |
| ccache-micropython-${{ matrix.name }}-${{ github.ref }} | |
| ccache-micropython-${{ matrix.name }}- | |
| - name: "Checkout Project" | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| path: ${{ env.CI_PROJECT_ROOT }} | |
| - name: "Install Arm GNU Toolchain (arm-none-eabi-gcc)" | |
| uses: carlosperate/arm-none-eabi-gcc-action@v1 | |
| with: | |
| release: '13.3.Rel1' | |
| - name: "Prepare tools & dependencies" | |
| shell: bash | |
| run: | | |
| 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 $CI_PROJECT_ROOT/ci/micropython.sh && ci_debug | |
| micropython_version | |
| ci_cmake_configure ${{ matrix.name }} | |
| - name: "MicroPython: Build" | |
| shell: bash | |
| run: | | |
| 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 }} | |
| - name: "Artifacts: Upload .uf2" | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.CI_RELEASE_FILENAME }}.uf2 | |
| path: ${{ env.CI_BUILD_ROOT }}/${{ env.CI_RELEASE_FILENAME }}.uf2 | |
| - name: "Release: Upload .uf2" | |
| if: github.event_name == 'release' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: ${{ env.CI_BUILD_ROOT }}/${{ env.CI_RELEASE_FILENAME }}.uf2 | |
| - name: "Artifacts: Upload .uf2 (With Filesystem)" | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| if-no-files-found: ignore | |
| name: ${{ env.CI_RELEASE_FILENAME }}-with-filesystem.uf2 | |
| path: ${{ env.CI_BUILD_ROOT }}/${{ env.CI_RELEASE_FILENAME }}-with-filesystem.uf2 | |
| - name: "Release: Upload .uf2 (With Filesystem)" | |
| if: github.event_name == 'release' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: ${{ env.CI_BUILD_ROOT }}/${{ env.CI_RELEASE_FILENAME }}-with-filesystem.uf2 |