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 tap ArmMbed/homebrew-formulae
27          brew install arm-none-eabi-gcc
28
29      - name: Build Project
30        # bash required otherwise this mysteriously (no error) fails at "Generating cyw43_bus_pio_spi.pio.h"
31        shell: bash
32        run: |
33          mkdir build
34          cd build
35          cmake .. -G "Unix Makefiles" -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_BOARD=pico_w
36          cmake --build .
37
38      - name: Build Native
39        # bash required otherwise this mysteriously (no error) fails at "Generating cyw43_bus_pio_spi.pio.h"
40        shell: bash
41        run: |
42          mkdir build_native
43          cd build_native
44          cmake .. -G "Unix Makefiles" -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_PLATFORM=host
45          cmake --build .
46