2021-01-24 14:52:59 +00:00
|
|
|
name: MicroPython
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
release:
|
|
|
|
types: [created]
|
|
|
|
|
|
|
|
env:
|
|
|
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
2021-06-23 12:36:44 +01:00
|
|
|
MICROPYTHON_VERSION: v1.16
|
2021-01-24 14:52:59 +00:00
|
|
|
BUILD_TYPE: Release
|
2021-04-19 14:02:38 +01:00
|
|
|
BOARD_TYPE: PICO
|
2021-01-24 14:52:59 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: ${{matrix.name}}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- os: ubuntu-20.04
|
|
|
|
name: Linux
|
|
|
|
cache-key: linux
|
|
|
|
cmake-args: '-DPICO_SDK_PATH=$GITHUB_WORKSPACE/pico-sdk'
|
|
|
|
apt-packages: clang-tidy gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib
|
|
|
|
|
|
|
|
runs-on: ${{matrix.os}}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
# Check out MicroPython
|
|
|
|
- name: Checkout MicroPython
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
2021-03-30 14:43:28 +01:00
|
|
|
repository: micropython/micropython
|
2021-04-19 12:40:03 +01:00
|
|
|
ref: ${{env.MICROPYTHON_VERSION}}
|
2021-01-24 14:52:59 +00:00
|
|
|
submodules: false # MicroPython submodules are hideously broken
|
|
|
|
path: micropython
|
|
|
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
2021-03-08 21:23:19 +00:00
|
|
|
submodules: true
|
2021-05-12 11:28:52 +01:00
|
|
|
path: pimoroni-pico-${{ github.sha }}
|
2021-01-24 14:52:59 +00:00
|
|
|
|
2021-07-28 11:21:27 +01:00
|
|
|
# Copy Python module files
|
|
|
|
- name: Copy modules
|
|
|
|
run: |
|
|
|
|
cp -r pimoroni-pico-${GITHUB_SHA}/micropython/modules_py/* micropython/ports/rp2/modules/
|
|
|
|
|
2021-01-24 14:52:59 +00:00
|
|
|
# Linux deps
|
|
|
|
- name: Install deps
|
|
|
|
if: runner.os == 'Linux'
|
|
|
|
run: |
|
|
|
|
sudo apt update && sudo apt install ${{matrix.apt-packages}}
|
|
|
|
|
|
|
|
- name: Fetch base MicroPython submodules
|
|
|
|
shell: bash
|
|
|
|
working-directory: micropython
|
|
|
|
run: git submodule update --init
|
|
|
|
|
|
|
|
- name: Fetch Pico SDK submodules
|
|
|
|
shell: bash
|
|
|
|
working-directory: micropython/lib/pico-sdk
|
|
|
|
run: git submodule update --init
|
|
|
|
|
|
|
|
- name: Build mpy-cross
|
|
|
|
shell: bash
|
|
|
|
working-directory: micropython/mpy-cross
|
|
|
|
run: make
|
|
|
|
|
|
|
|
- name: Build MicroPython
|
|
|
|
shell: bash
|
|
|
|
working-directory: micropython/ports/rp2
|
2021-05-12 11:28:52 +01:00
|
|
|
run: make USER_C_MODULES=../../../pimoroni-pico-${GITHUB_SHA}/micropython/modules/micropython.cmake -j2
|
2021-01-24 14:52:59 +00:00
|
|
|
|
2021-05-20 14:10:57 +01:00
|
|
|
- name: Store .uf2 as artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ${{github.event.repository.name}}-${{github.event.release.tag_name}}-micropython-${{env.MICROPYTHON_VERSION}}.uf2
|
|
|
|
path: micropython/ports/rp2/build-${{env.BOARD_TYPE}}/firmware.uf2
|
|
|
|
|
2021-01-24 14:52:59 +00:00
|
|
|
- name: Upload .uf2
|
|
|
|
if: github.event_name == 'release'
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
with:
|
2021-04-19 14:02:38 +01:00
|
|
|
asset_path: micropython/ports/rp2/build-${{env.BOARD_TYPE}}/firmware.uf2
|
2021-01-24 14:52:59 +00:00
|
|
|
upload_url: ${{github.event.release.upload_url}}
|
2021-04-19 12:40:03 +01:00
|
|
|
asset_name: ${{github.event.repository.name}}-${{github.event.release.tag_name}}-micropython-${{env.MICROPYTHON_VERSION}}.uf2
|
2021-03-08 21:23:19 +00:00
|
|
|
asset_content_type: application/octet-stream
|