This is a GitHub Action for building projects with C/C++ for the Raspberry Pi Pico series.
- Pico SDK 2.1.1
- Projects with CMakeLists.txt
To use this GitHub Action in your workflow, add the following step to your .github/workflows/your-workflow.yml
file:
- For Raspberry Pi Pico
name: Build Raspberry Pi Pico Project
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build-pico
uses: elehobica/build-pico@v1
- For Raspberry Pi Pico 2
name: Build Raspberry Pi Pico 2 Project
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build-pico
uses: elehobica/build-pico@v1
with:
platform: rp2350
board: pico2
-
path
Target path to the project directory. The directory should be desinated as the relative path from the GitHub Action's working directory.CMakesList.txt
must be under the directory. Default is.
, supposing that the action is used just after checkout andCMakesList.txt
exists in the root directory of the repository. -
jobs
Number of jobs to be applied tomake
. Default is calculated as the number of the CPU + 1. -
build
Build directory. Default isbuild
. The directory should be desinated as the relative path from the path. -
keep
Not to delete the build directory. Default is 0, which deletes the build directory before applyingcmake
if it exists. -
platform
Platform to be designated withcmake
. It will be givens as-DPICO_PLATFORM=
. Default is rp2040. If the target board is Raspberry Pi Pico 2, it should be rp2350. -
board
Board to be designated withcmake
. It will be givens as-DPICO_BOARD=
. Default is pico. If the target board is Raspberry Pi Pico 2, it should be pico2. -
cmake_options
Additional options to be given tocmake
.