From 9629f6bc93e18d21ffdce029f5470bc17064a029 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Sat, 26 Apr 2025 14:29:08 +0100 Subject: [PATCH 1/5] 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 --- .github/workflows/cmake.yml | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 502e18c14..b13adf0d1 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -33,28 +33,43 @@ jobs: working-directory: ${{github.workspace}}/pico-sdk run: git submodule update --init - - name: Create Build Environment + - name: Create Build Environment (Pico) # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands working-directory: ${{github.workspace}}/pico-examples - run: cmake -E make_directory ${{github.workspace}}/pico-examples/build + run: cmake -E make_directory ${{github.workspace}}/pico-examples/build.pico - - name: Configure CMake + - name: Configure CMake (Pico) # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{github.workspace}}/pico-examples/build + working-directory: ${{github.workspace}}/pico-examples/build.pico # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 - run: PICO_SDK_PATH=../../pico-sdk cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE + run: PICO_SDK_PATH=../../pico-sdk cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPICO_BOARD=pico - name: Get core count id: core_count run : cat /proc/cpuinfo | grep processor | wc -l - - name: Build - working-directory: ${{github.workspace}}/pico-examples/build + - name: Build (Pico) + working-directory: ${{github.workspace}}/pico-examples/build.pico + shell: bash + # Execute the build. You can specify a specific target with "--target " + run: cmake --build . --config $BUILD_TYPE --parallel $(nproc) + + - name: Create Build Environment (Pico 2 W) + working-directory: ${{github.workspace}}/pico-examples + run: cmake -E make_directory ${{github.workspace}}/pico-examples/build.pico2_w + + - name: Configure CMake (Pico 2 W) + shell: bash + working-directory: ${{github.workspace}}/pico-examples/build.pico2_w + run: PICO_SDK_PATH=../../pico-sdk cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPICO_BOARD=pico2_w + + - name: Build (Pico 2 W) + working-directory: ${{github.workspace}}/pico-examples/build.pico2_w shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config $BUILD_TYPE --parallel $(nproc) From 202737784890ee1781ad48e9c240d47e02024f72 Mon Sep 17 00:00:00 2001 From: William Vinnicombe Date: Tue, 29 Apr 2025 13:34:26 +0100 Subject: [PATCH 2/5] Revert "Add separate builds for Pico and Pico 2 W to GiHub CI" This reverts commit 9629f6bc93e18d21ffdce029f5470bc17064a029. --- .github/workflows/cmake.yml | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b13adf0d1..502e18c14 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -33,43 +33,28 @@ jobs: working-directory: ${{github.workspace}}/pico-sdk run: git submodule update --init - - name: Create Build Environment (Pico) + - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands working-directory: ${{github.workspace}}/pico-examples - run: cmake -E make_directory ${{github.workspace}}/pico-examples/build.pico + run: cmake -E make_directory ${{github.workspace}}/pico-examples/build - - name: Configure CMake (Pico) + - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{github.workspace}}/pico-examples/build.pico + working-directory: ${{github.workspace}}/pico-examples/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 - run: PICO_SDK_PATH=../../pico-sdk cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPICO_BOARD=pico + run: PICO_SDK_PATH=../../pico-sdk cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE - name: Get core count id: core_count run : cat /proc/cpuinfo | grep processor | wc -l - - name: Build (Pico) - working-directory: ${{github.workspace}}/pico-examples/build.pico - shell: bash - # Execute the build. You can specify a specific target with "--target " - run: cmake --build . --config $BUILD_TYPE --parallel $(nproc) - - - name: Create Build Environment (Pico 2 W) - working-directory: ${{github.workspace}}/pico-examples - run: cmake -E make_directory ${{github.workspace}}/pico-examples/build.pico2_w - - - name: Configure CMake (Pico 2 W) - shell: bash - working-directory: ${{github.workspace}}/pico-examples/build.pico2_w - run: PICO_SDK_PATH=../../pico-sdk cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPICO_BOARD=pico2_w - - - name: Build (Pico 2 W) - working-directory: ${{github.workspace}}/pico-examples/build.pico2_w + - name: Build + working-directory: ${{github.workspace}}/pico-examples/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config $BUILD_TYPE --parallel $(nproc) From 2813eec049d7a228884d66e5e59db34c190f70c0 Mon Sep 17 00:00:00 2001 From: William Vinnicombe Date: Tue, 29 Apr 2025 13:42:28 +0100 Subject: [PATCH 3/5] 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 --- .github/workflows/cmake.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 502e18c14..e9cfa92b2 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -9,6 +9,10 @@ jobs: build: if: github.repository_owner == 'raspberrypi' runs-on: [self-hosted, Linux, X64] + strategy: + fail-fast: false + matrix: + board: ["pico", "pico2_w"] steps: - name: Clean workspace @@ -37,24 +41,24 @@ jobs: # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands working-directory: ${{github.workspace}}/pico-examples - run: cmake -E make_directory ${{github.workspace}}/pico-examples/build + run: cmake -E make_directory ${{github.workspace}}/pico-examples/build.${{ matrix.board }} - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{github.workspace}}/pico-examples/build + working-directory: ${{github.workspace}}/pico-examples/build.${{ matrix.board }} # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 - run: PICO_SDK_PATH=../../pico-sdk cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE + run: PICO_SDK_PATH=../../pico-sdk cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPICO_BOARD=${{ matrix.board }} - name: Get core count id: core_count run : cat /proc/cpuinfo | grep processor | wc -l - name: Build - working-directory: ${{github.workspace}}/pico-examples/build + working-directory: ${{github.workspace}}/pico-examples/build.${{ matrix.board }} shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config $BUILD_TYPE --parallel $(nproc) From 9c0f325dc8d6aff5d1294bfe0ce86e0eadb8b812 Mon Sep 17 00:00:00 2001 From: William Vinnicombe Date: Tue, 29 Apr 2025 13:45:42 +0100 Subject: [PATCH 4/5] Prevent running twice for PRs from the same repo --- .github/workflows/cmake.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index e9cfa92b2..360cf54a5 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -7,7 +7,8 @@ env: jobs: build: - if: github.repository_owner == 'raspberrypi' + # Prevent running twice for PRs from same repo + 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) runs-on: [self-hosted, Linux, X64] strategy: fail-fast: false From 098b210e7c91a05d27c7145bd5f9233a5454eb0e Mon Sep 17 00:00:00 2001 From: William Vinnicombe Date: Tue, 29 Apr 2025 13:54:56 +0100 Subject: [PATCH 5/5] Set WIFI_SSID and WIFI_PASSWORD to build more wireless examples --- .github/workflows/cmake.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 360cf54a5..a224dde61 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -52,7 +52,8 @@ jobs: # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 - run: PICO_SDK_PATH=../../pico-sdk cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPICO_BOARD=${{ matrix.board }} + # Set WIFI_SSID and WIFI_PASSWORD to build all of the wireless examples + run: PICO_SDK_PATH=../../pico-sdk cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPICO_BOARD=${{ matrix.board }} -DWIFI_SSID=TestSSID -DWIFI_PASSWORD=TestPassword - name: Get core count id: core_count