Skip to content

GitHub Action to build projects for Raspberry Pi Pico series

License

Notifications You must be signed in to change notification settings

elehobica/build-pico

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Build-Pico

This is a GitHub Action for building projects with C/C++ for the Raspberry Pi Pico series.

Build

Overview

  • Pico SDK 2.1.1
  • Projects with CMakeLists.txt

Usage

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

Inputs

  • 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 and CMakesList.txt exists in the root directory of the repository.

  • jobs
    Number of jobs to be applied to make. Default is calculated as the number of the CPU + 1.

  • build
    Build directory. Default is build. 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 applying cmake if it exists.

  • platform
    Platform to be designated with cmake. 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 with cmake. 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 to cmake.