2021-01-24 14:52:59 +00:00
|
|
|
name: CMake
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
env:
|
|
|
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
|
|
|
BUILD_TYPE: Release
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-01-26 14:29:16 +00:00
|
|
|
name: ${{matrix.name}} (C++)
|
|
|
|
runs-on: ubuntu-20.04
|
2021-01-24 14:52:59 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
2023-01-26 14:29:16 +00:00
|
|
|
- name: Pico
|
|
|
|
board: pico
|
|
|
|
- name: Pico W
|
|
|
|
board: pico_w
|
2021-01-24 14:52:59 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
PICO_SDK_PATH: $GITHUB_WORKSPACE/pico-sdk
|
|
|
|
|
|
|
|
steps:
|
2022-03-11 10:24:39 +00:00
|
|
|
- name: Compiler Cache
|
2022-12-19 12:34:20 +00:00
|
|
|
uses: actions/cache@v3
|
2022-03-11 10:24:39 +00:00
|
|
|
with:
|
|
|
|
path: /home/runner/.ccache
|
|
|
|
key: ccache-cmake-${{github.ref}}-${{github.sha}}
|
|
|
|
restore-keys: |
|
|
|
|
ccache-cmake-${{github.ref}}
|
|
|
|
ccache-cmake
|
|
|
|
|
2022-12-19 12:34:20 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-05-11 17:31:38 +01:00
|
|
|
with:
|
|
|
|
submodules: true
|
2021-01-24 14:52:59 +00:00
|
|
|
|
|
|
|
# Check out the Pico SDK
|
|
|
|
- name: Checkout Pico SDK
|
2022-12-19 12:34:20 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-01-24 14:52:59 +00:00
|
|
|
with:
|
|
|
|
repository: raspberrypi/pico-sdk
|
|
|
|
path: pico-sdk
|
|
|
|
submodules: true
|
|
|
|
|
2021-03-31 14:00:50 +01:00
|
|
|
# Check out the Pico Extras
|
|
|
|
- name: Checkout Pico Extras
|
2022-12-19 12:34:20 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-03-31 14:00:50 +01:00
|
|
|
with:
|
|
|
|
repository: raspberrypi/pico-extras
|
|
|
|
path: pico-extras
|
2022-03-11 10:24:39 +00:00
|
|
|
submodules: false # lwip breaks audio submodule fetching
|
2021-03-31 14:00:50 +01:00
|
|
|
|
2021-01-24 14:52:59 +00:00
|
|
|
# Linux deps
|
|
|
|
- name: Install deps
|
|
|
|
if: runner.os == 'Linux'
|
|
|
|
run: |
|
2023-01-26 14:29:16 +00:00
|
|
|
sudo apt update && sudo apt install ccache gcc-arm-none-eabi
|
2021-01-24 14:52:59 +00:00
|
|
|
|
|
|
|
- name: Create Build Environment
|
|
|
|
run: cmake -E make_directory ${{runner.workspace}}/build
|
|
|
|
|
|
|
|
- name: Configure CMake
|
|
|
|
shell: bash
|
|
|
|
working-directory: ${{runner.workspace}}/build
|
2023-01-26 14:29:16 +00:00
|
|
|
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DPICO_SDK_PATH=$GITHUB_WORKSPACE/pico-sdk -DPICO_SDK_POST_LIST_DIRS=$GITHUB_WORKSPACE/pico-extras -DPICO_BOARD=${{matrix.board}}
|
2021-01-24 14:52:59 +00:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
working-directory: ${{runner.workspace}}/build
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-03-11 10:24:39 +00:00
|
|
|
ccache --zero-stats || true
|
2021-05-11 17:31:38 +01:00
|
|
|
cmake --build . --config $BUILD_TYPE -j 2
|
2022-03-11 10:24:39 +00:00
|
|
|
ccache --show-stats || true
|