Most of my changes #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CMake | |
on: | |
push: | |
pull_request: | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
name: ${{matrix.name}} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-20.04 | |
name: CMake Build | |
cache-key: picosystem | |
cmake-args: -DPICO_SDK_PATH=$GITHUB_WORKSPACE/pico-sdk -DPICOSYSTEM_DIR=$GITHUB_WORKSPACE/picosystem -DPICO_BOARD=pimoroni_picosystem -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
apt-packages: ccache gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib python3-setuptools | |
runs-on: ${{matrix.os}} | |
env: | |
RELEASE_FILE: ${{github.event.repository.name}}-${{github.sha}} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
path: code | |
# PicoSystem SDK | |
- name: Checkout PicoSystem SDK | |
uses: actions/checkout@v3 | |
with: | |
repository: pimoroni/picosystem | |
path: picosystem | |
submodules: true | |
# Pico SDK | |
- name: Checkout Pico SDK | |
uses: actions/checkout@v3 | |
with: | |
repository: raspberrypi/pico-sdk | |
path: pico-sdk | |
submodules: true | |
- name: Cache | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/.ccache | |
key: ccache-${{matrix.cache-key}}-${{github.ref}}-${{github.sha}} | |
restore-keys: | | |
ccache-${{matrix.cache-key}}-${{github.ref}} | |
ccache-${{matrix.cache-key}}- | |
# Linux deps | |
- name: Install deps | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt update && sudo apt install ${{matrix.apt-packages}} | |
- name: Create Build Environment | |
run: | | |
cmake -E make_directory ${{runner.workspace}}/build | |
- name: Configure CMake (Examples) | |
shell: bash | |
working-directory: ${{runner.workspace}}/build | |
run: cmake $GITHUB_WORKSPACE/code -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCPACK_PACKAGE_FILE_NAME=${{env.RELEASE_FILE}} ${{matrix.cmake-args}} | |
- name: Build | |
working-directory: ${{runner.workspace}}/build | |
shell: bash | |
run: | | |
ccache --zero-stats || true | |
cmake --build . --config $BUILD_TYPE -j 2 | |
ccache --show-stats || true | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{env.RELEASE_FILE}} | |
path: ${{runner.workspace}}/build/ |