1name: Build on macOS
2on:
3  workflow_dispatch:
4  push:
5    branches:
6      - 'develop'
7      - 'master'
8      - 'test_workflow'
9
10jobs:
11  build:
12    runs-on: macos-12
13    steps:
14      - name: Clean workspace
15        run: |
16          echo "Cleaning up previous run"
17          rm -rf "${{ github.workspace }}"
18          mkdir -p "${{ github.workspace }}"
19      - name: Checkout repo
20        uses: actions/checkout@v3
21      - name: Checkout submodules
22        run: git submodule update --init
23      - name: Install dependencies
24        run: |
25          brew install cmake
26          brew install --cask gcc-arm-embedded
27
28      - name: Build Project
29        # bash required otherwise this mysteriously (no error) fails at "Generating cyw43_bus_pio_spi.pio.h"
30        shell: bash
31        run: |
32          mkdir build
33          cd build
34          cmake .. -G "Unix Makefiles" -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_BOARD=pico_w
35          cmake --build .
36
37      - name: Build Native
38        # bash required otherwise this mysteriously (no error) fails at "Generating cyw43_bus_pio_spi.pio.h"
39        shell: bash
40        run: |
41          mkdir build_native
42          cd build_native
43          cmake .. -G "Unix Makefiles" -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_PLATFORM=host
44          cmake --build .
45