From 03f97a8999588ecdfe7ae942284263817c285f96 Mon Sep 17 00:00:00 2001 From: graham sanderson Date: Thu, 9 Feb 2023 20:28:22 -0600 Subject: [PATCH] Add new github workflows --- .github/workflows/choco_packages.config | 7 + .github/workflows/macOS.yml | 59 ++++++++ .github/workflows/multi-gcc.yml | 185 ++++++++++++++++++++++++ .github/workflows/windows.yml | 48 ++++++ 4 files changed, 299 insertions(+) create mode 100644 .github/workflows/choco_packages.config create mode 100644 .github/workflows/macOS.yml create mode 100644 .github/workflows/multi-gcc.yml create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/choco_packages.config b/.github/workflows/choco_packages.config new file mode 100644 index 0000000..b2d3db1 --- /dev/null +++ b/.github/workflows/choco_packages.config @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.github/workflows/macOS.yml b/.github/workflows/macOS.yml new file mode 100644 index 0000000..e3a37a6 --- /dev/null +++ b/.github/workflows/macOS.yml @@ -0,0 +1,59 @@ +name: Build on macOS +on: + workflow_dispatch: + push: + branches: + - 'test_workflow' + - 'develop' + - 'master' + +jobs: + build: + runs-on: macos-12 + steps: + - name: Clean workspace + run: | + echo "Cleaning up previous run" + rm -rf "${{ github.workspace }}" + mkdir -p "${{ github.workspace }}" + + - name: Checkout pico-examples + uses: actions/checkout@v2 + with: + path: pico-examples + + - name: Checkout pico-sdk/develop + uses: actions/checkout@v2 + with: + repository: raspberrypi/pico-sdk + ref: develop + path: pico-sdk + + - name: Checkout pico-sdk submodules + working-directory: ${{github.workspace}}/pico-sdk + run: git submodule update --init + - name: Install dependencies + run: | + brew install cmake + brew tap ArmMbed/homebrew-formulae + brew install arm-none-eabi-gcc + + - name: Build Project + working-directory: ${{github.workspace}}/pico-examples + # bash required otherwise this mysteriously (no error) fails at "Generating cyw43_bus_pio_spi.pio.h" + shell: bash + run: | + mkdir build + cd build + cmake .. -G "Unix Makefiles" -DPICO_SDK_PATH=../../pico-sdk -DCMAKE_BUILD_TYPE=Debug -DPICO_BOARD=pico_w + cmake --build . + + - name: Build Native + working-directory: ${{github.workspace}}/pico-examples + # bash required otherwise this mysteriously (no error) fails at "Generating cyw43_bus_pio_spi.pio.h" + shell: bash + run: | + mkdir build_native + cd build_native + cmake .. -G "Unix Makefiles" -DPICO_SDK_PATH=../../pico-sdk -DCMAKE_BUILD_TYPE=Debug -DPICO_PLATFORM=host + cmake --build . \ No newline at end of file diff --git a/.github/workflows/multi-gcc.yml b/.github/workflows/multi-gcc.yml new file mode 100644 index 0000000..64ba44a --- /dev/null +++ b/.github/workflows/multi-gcc.yml @@ -0,0 +1,185 @@ +name: Multi GCC +on: + workflow_dispatch: + push: + branches: + - 'master' + - 'test_workflow' + +jobs: + build: + if: github.repository_owner == 'raspberrypi' + runs-on: [self-hosted, Linux, X64] + + steps: + - name: Clean workspace + run: | + echo "Cleaning up previous run" + rm -rf "${{ github.workspace }}" + mkdir -p "${{ github.workspace }}" + + - name: Checkout pico-examples + uses: actions/checkout@v2 + with: + path: pico-examples + + - name: Checkout pico-sdk/develop + uses: actions/checkout@v2 + with: + repository: raspberrypi/pico-sdk + ref: develop + path: pico-sdk + + - name: Checkout pico-sdk submodules + working-directory: ${{github.workspace}}/pico-sdk + run: git submodule update --init + + - 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 + + - name: Get core count + id: core_count + run : cat /proc/cpuinfo | grep processor | wc -l + + - name: GCC 6.2.1 Debug + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-6_2-2016q4 -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 6.2.1 Release + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-6_2-2016q4 -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 6.3.1 Debug + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-6-2017-q2-update -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 6.3.1 Release + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-6-2017-q2-update -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 7.2.1 Debug + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-7-2017-q4-major -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 7.2.1 Release + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-7-2017-q4-major -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 7.3.1 Debug + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-7-2018-q2-update -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 7.3.1 Release + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-7-2018-q2-update -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 8.2.1 Debug + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-8-2018-q4-major -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 8.2.1 Release + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-8-2018-q4-major -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 8.3.1 Debug + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-8-2019-q3-update -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 8.3.1 Release + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-8-2019-q3-update -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 9.2.1 Debug + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-9-2019-q4-major -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 9.2.1 Release + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-9-2019-q4-major -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 9.3.1 Debug + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-9-2020-q2-update -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 9.3.1 Release + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-9-2020-q2-update -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 10.2.1 Debug + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-10-2020-q4-major -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 10.2.1 Release + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-10-2020-q4-major -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 10.3.1 Debug + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-10.3-2021.10 -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 10.3.1 Release + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-none-eabi-10.3-2021.10 -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 11.2.1 Debug + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 11.2.1 Release + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 11.3.1 Debug + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 11.3.1 Release + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 12.2.1 Debug + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=/opt/arm/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: GCC 12.2.1 Release + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Release -DPICO_TOOLCHAIN_PATH=/opt/arm/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi -DPICO_BOARD=pico_w; make -j ${{steps.core_count.outputs.output}} + + - name: Native Debug + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Debug -DPICO_PLATFORM=host; make -j ${{steps.core_count.outputs.output}} + + - name: Native Release + if: always() + shell: bash + run: cd ${{github.workspace}}/pico-examples; mkdir -p build; rm -rf build/*; cd build; PICO_SDK_PATH=../../pico-sdk cmake ../ -DCMAKE_BUILD_TYPE=Release -DPICO_PLATFORM=host; make -j ${{steps.core_count.outputs.output}} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..f5dc4e7 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,48 @@ +name: Build on Windows +on: + workflow_dispatch: + push: + branches: + - 'test_workflow' + - 'develop' + - 'master' + +jobs: + build: + runs-on: windows-2022 + steps: + - name: Clean workspace + shell: bash + run: | + echo "Cleaning up previous run" + rm -rf "${{ github.workspace }}/pico-sdk" + rm -rf "${{ github.workspace }}/pico-examples" + - name: Checkout pico-examples + uses: actions/checkout@v2 + with: + path: pico-examples + + - name: Checkout pico-sdk/develop + uses: actions/checkout@v2 + with: + repository: raspberrypi/pico-sdk + ref: develop + path: pico-sdk + + - name: Checkout pico-sdk submodules + working-directory: ${{github.workspace}}/pico-sdk + run: git submodule update --init + + - name: Install dependencies + working-directory: ${{github.workspace}}/pico-examples + run: choco install .github/workflows/choco_packages.config + + - name: Build Project + working-directory: ${{github.workspace}}/pico-examples + # bash required otherwise this mysteriously (no error) fails at "Generating cyw43_bus_pio_spi.pio.h" + shell: bash + run: | + mkdir build + cd build + cmake .. -G Ninja -DPICO_SDK_PATH=../../pico-sdk -DCMAKE_BUILD_TYPE=Debug -DPICO_BOARD=pico_w + cmake --build .