Skip to content

Commit 2813eec

Browse files
committed
Add separate builds for Pico and Pico 2 W to GitHub CI
Many of the pico-examples are RP2350 only, so add a Pico 2 W build job so that these (and the wireless-only examples) get test-built too
1 parent 2027377 commit 2813eec

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/cmake.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ jobs:
99
build:
1010
if: github.repository_owner == 'raspberrypi'
1111
runs-on: [self-hosted, Linux, X64]
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
board: ["pico", "pico2_w"]
1216

1317
steps:
1418
- name: Clean workspace
@@ -37,24 +41,24 @@ jobs:
3741
# Some projects don't allow in-source building, so create a separate build directory
3842
# We'll use this as our working directory for all subsequent commands
3943
working-directory: ${{github.workspace}}/pico-examples
40-
run: cmake -E make_directory ${{github.workspace}}/pico-examples/build
44+
run: cmake -E make_directory ${{github.workspace}}/pico-examples/build.${{ matrix.board }}
4145

4246
- name: Configure CMake
4347
# Use a bash shell so we can use the same syntax for environment variable
4448
# access regardless of the host operating system
4549
shell: bash
46-
working-directory: ${{github.workspace}}/pico-examples/build
50+
working-directory: ${{github.workspace}}/pico-examples/build.${{ matrix.board }}
4751
# Note the current convention is to use the -S and -B options here to specify source
4852
# and build directories, but this is only available with CMake 3.13 and higher.
4953
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
50-
run: PICO_SDK_PATH=../../pico-sdk cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE
54+
run: PICO_SDK_PATH=../../pico-sdk cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPICO_BOARD=${{ matrix.board }}
5155

5256
- name: Get core count
5357
id: core_count
5458
run : cat /proc/cpuinfo | grep processor | wc -l
5559

5660
- name: Build
57-
working-directory: ${{github.workspace}}/pico-examples/build
61+
working-directory: ${{github.workspace}}/pico-examples/build.${{ matrix.board }}
5862
shell: bash
5963
# Execute the build. You can specify a specific target with "--target <NAME>"
6064
run: cmake --build . --config $BUILD_TYPE --parallel $(nproc)

0 commit comments

Comments
 (0)