Skip to content

Commit 09a3671

Browse files
lurchwill-v-pi
andauthored
Add separate builds for Pico and Pico 2 W to GiHub CI (#638)
* Add separate builds for Pico and Pico 2 W to GiHub 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 * Revert "Add separate builds for Pico and Pico 2 W to GiHub CI" This reverts commit 9629f6b. * 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 * Prevent running twice for PRs from the same repo * Set WIFI_SSID and WIFI_PASSWORD to build more wireless examples --------- Co-authored-by: William Vinnicombe <[email protected]>
1 parent 6468b45 commit 09a3671

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

.github/workflows/cmake.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@ env:
77

88
jobs:
99
build:
10-
if: github.repository_owner == 'raspberrypi'
10+
# Prevent running twice for PRs from same repo
11+
if: github.repository_owner == 'raspberrypi' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)
1112
runs-on: [self-hosted, Linux, X64]
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
board: ["pico", "pico2_w"]
1217

1318
steps:
1419
- name: Clean workspace
@@ -37,24 +42,25 @@ jobs:
3742
# Some projects don't allow in-source building, so create a separate build directory
3843
# We'll use this as our working directory for all subsequent commands
3944
working-directory: ${{github.workspace}}/pico-examples
40-
run: cmake -E make_directory ${{github.workspace}}/pico-examples/build
45+
run: cmake -E make_directory ${{github.workspace}}/pico-examples/build.${{ matrix.board }}
4146

4247
- name: Configure CMake
4348
# Use a bash shell so we can use the same syntax for environment variable
4449
# access regardless of the host operating system
4550
shell: bash
46-
working-directory: ${{github.workspace}}/pico-examples/build
51+
working-directory: ${{github.workspace}}/pico-examples/build.${{ matrix.board }}
4752
# Note the current convention is to use the -S and -B options here to specify source
4853
# and build directories, but this is only available with CMake 3.13 and higher.
4954
# 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
55+
# Set WIFI_SSID and WIFI_PASSWORD to build all of the wireless examples
56+
run: PICO_SDK_PATH=../../pico-sdk cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPICO_BOARD=${{ matrix.board }} -DWIFI_SSID=TestSSID -DWIFI_PASSWORD=TestPassword
5157

5258
- name: Get core count
5359
id: core_count
5460
run : cat /proc/cpuinfo | grep processor | wc -l
5561

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

0 commit comments

Comments
 (0)