Skip to content

follow up to #33

follow up to #33 #92

Workflow file for this run

name: Pico SDK
on:
pull_request:
branches: [master]
paths:
- "src/*.cpp"
- "!src/py_bindings.cpp"
- "src/*.h"
- "src/CMakeLists.txt"
- "src/utility/rp2/**"
- "examples/pico_sdk/**"
- ".github/workflows/build_pico_sdk.yml"
push:
branches: [master]
paths:
- "src/*.cpp"
- "!src/py_bindings.cpp"
- "src/*.h"
- "src/CMakeLists.txt"
- "src/utility/rp2/**"
- "examples/pico_sdk/**"
- ".github/workflows/build_pico_sdk.yml"
jobs:
check_formatting:
uses: ./.github/workflows/cpp_lint.yaml
with:
ignore: '!examples/pico_sdk|'
build:
needs: check_formatting
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
board:
- "pico"
- "pico_w"
- "adafruit_feather_rp2040"
- "adafruit_itsybitsy_rp2040"
- "adafruit_qtpy_rp2040"
i2c-bus: [USE_I2C=ON, USE_I2C=OFF]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
steps:
- name: get repo info
id: lib-info
run: echo "name=$(echo ${{ github.repository }} | sed 's;.\+/;;')" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
path: ${{ steps.lib-info.outputs.name }}
- name: Install toolchain
run: sudo apt update && sudo apt install gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential
- name: Clone pico-sdk
uses: actions/checkout@v4
with:
repository: raspberrypi/pico-sdk
# master branch is latest stable release
path: pico-sdk
clean: false
submodules: true
- name: Checkout pico-sdk submodules
working-directory: ${{ github.workspace }}/pico-sdk
run: git submodule update --init
- name: Create Build Environment
working-directory: ${{ github.workspace }}/${{ steps.lib-info.outputs.name }}
run: mkdir build
- name: Configure CMake
working-directory: ${{ github.workspace }}/${{ steps.lib-info.outputs.name }}/build
env:
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk
run: cmake ../examples/pico_sdk -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPICO_BOARD=${{ matrix.board }} -D${{ matrix.i2c-bus }}
- name: Build
working-directory: ${{ github.workspace }}/${{ steps.lib-info.outputs.name }}/build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
- name: Save artifact
uses: actions/upload-artifact@v4
with:
name: examples_pico_${{ matrix.board }}_${{ matrix.i2c-bus }}
path: |
${{ github.workspace }}/${{ steps.lib-info.outputs.name }}/build/**/*.uf2
# ${{ github.workspace }}/${{ steps.lib-info.outputs.name }}/build/**/*.elf
# ${{ github.workspace }}/${{ steps.lib-info.outputs.name }}/build/**/*.hex
# ${{ github.workspace }}/${{ steps.lib-info.outputs.name }}/build/**/*.bin