Github Actions Workflow (#17)

* C++ libs/examples workflow
* MicroPython workflow
* Workaround broken MicroPython submodules (http does not support shallow clones)
* Upload .uf2 to releases
* Switch to CI fork of uP for custom config - https://github.com/pimoroni/micropython/tree/continuous-integration
pull/13/head
Philip Howard 2021-01-24 14:52:59 +00:00 zatwierdzone przez GitHub
rodzic c6922cd239
commit daac2c64d5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 133 dodań i 0 usunięć

57
.github/workflows/cmake.yml vendored 100644
Wyświetl plik

@ -0,0 +1,57 @@
name: CMake
on:
push:
pull_request:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
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}}
env:
PICO_SDK_PATH: $GITHUB_WORKSPACE/pico-sdk
steps:
- uses: actions/checkout@v2
# Check out the Pico SDK
- name: Checkout Pico SDK
uses: actions/checkout@v2
with:
repository: raspberrypi/pico-sdk
path: pico-sdk
submodules: true
# Linux deps
- name: Install deps
if: runner.os == 'Linux'
run: |
sudo apt update && sudo apt install ${{matrix.apt-packages}}
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE ${{matrix.cmake-args}}
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: |
cmake --build . --config $BUILD_TYPE -j 2

Wyświetl plik

@ -0,0 +1,76 @@
name: MicroPython
on:
push:
pull_request:
release:
types: [created]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
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:
repository: pimoroni/micropython
ref: continuous-integration
submodules: false # MicroPython submodules are hideously broken
path: micropython
- uses: actions/checkout@v2
with:
path: pimoroni-pico
# 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
run: make USER_C_MODULES=../../../pimoroni-pico/micropython/modules -j2
- name: Upload .uf2
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
asset_path: micropython/ports/rp2/build/firmware.uf2
upload_url: ${{github.event.release.upload_url}}
asset_name: pimoroni-pico-micropython.uf2
asset_content_type: application/octet-stream