Skip to content

Update CI workflow for Node 22-compatible actions #24

Update CI workflow for Node 22-compatible actions

Update CI workflow for Node 22-compatible actions #24

Workflow file for this run

name: CMake
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
# Arm GNU toolchain is installed via apt and lives under /usr/bin.
PICO_TOOLCHAIN_PATH: /usr
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
permissions:
contents: read
steps:
# Install the Arm GNU Toolchain.
# 'latest' tracks the current Arm GNU Toolchain release (currently 15.2.Rel1 / GCC 15.2 as of 2025-12-17).
# Pin to a specific release (e.g. '13.3.Rel1') for reproducible builds.
- name: Install ARM GCC
run: |
set -euxo pipefail
sudo apt-get update
sudo apt-get install -y gcc-arm-none-eabi libnewlib-arm-none-eabi
- name: Checkout repository and submodules
uses: actions/checkout@v6
with:
submodules: recursive
- name: Cache CMake build directory
uses: actions/cache@v5
with:
path: _build
key: cmake-${{ runner.os }}-${{ hashFiles('CMakeLists.txt', 'src/**', 'pico-sdk/CMakeLists.txt', '.github/workflows/cmake.yml') }}
restore-keys: |
cmake-${{ runner.os }}-
- name: Configure CMake
run: |
set -euxo pipefail
rm -f _build/CMakeCache.txt
cmake -S . -B _build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
- name: Build
run: |
set -euxo pipefail
cmake --build _build --config ${{ env.BUILD_TYPE }}
- name: Test
working-directory: ${{github.workspace}}/_build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
set -euxo pipefail
ctest -C ${{env.BUILD_TYPE}}
- name: Show build artifacts
run: |
set -euxo pipefail
find _build/ -type f -name "*.uf2" -ls