expose selected driver in python binding (#8) #73
This file contains 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: 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" | |
# - "pimoroni_tiny2040" # examples require PicoSDK v1.2.0 | |
# - "sparkfun_micromod" # examples require PicoSDK v1.2.0 | |
# - "arduino_nano_rp2040_connect" # requires PicoSDK v1.2.0 | |
i2c-bus: [USE_I2C=ON, USE_I2C=OFF] | |
dr-pin: [USE_SW_DR=ON, USE_SW_DR=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 }} -D${{ matrix.dr-pin }} | |
- 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 }}_${{ matrix.dr-pin }} | |
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 |