CI: Cache CMake build
@@ -18,7 +18,7 @@ jobs:
name: Linux
cache-key: linux
cmake-args: '-DPICO_SDK_PATH=$GITHUB_WORKSPACE/pico-sdk -DPICO_SDK_POST_LIST_DIRS=$GITHUB_WORKSPACE/pico-extras'
- apt-packages: clang-tidy gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib
+ apt-packages: ccache gcc-arm-none-eabi
runs-on: ${{matrix.os}}
@@ -26,6 +26,15 @@ jobs:
PICO_SDK_PATH: $GITHUB_WORKSPACE/pico-sdk
steps:
+ - name: Compiler Cache
+ uses: actions/cache@v2
+ with:
+ path: /home/runner/.ccache
+ key: ccache-cmake-${{github.ref}}-${{github.sha}}
+ restore-keys: |
+ ccache-cmake-${{github.ref}}
+ ccache-cmake
+
- uses: actions/checkout@v2
with:
submodules: true
@@ -44,7 +53,7 @@ jobs:
with:
repository: raspberrypi/pico-extras
path: pico-extras
- submodules: false # lwip breaks audio submodule fetchin
+ submodules: false # lwip breaks audio submodule fetching
# Linux deps
- name: Install deps
@@ -58,10 +67,12 @@ jobs:
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
- run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE ${{matrix.cmake-args}}
+ run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ${{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
