[ci] Use sccache for cmake builds (#5692)

This commit is contained in:
Peter Johnson
2023-09-29 23:38:01 -07:00
committed by GitHub
parent 703dedc4a6
commit 8f5bcad244
2 changed files with 34 additions and 8 deletions

View File

@@ -28,20 +28,27 @@ jobs:
runs-on: ubuntu-22.04
container: wpilib/roborio-cross-ubuntu:2023-22.04
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y libopencv-dev libopencv4.5-java python-is-python3 clang-14
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- name: Install jinja
run: python -m pip install jinja2
- uses: actions/checkout@v3
- name: configure
run: mkdir build && cd build && cmake -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/clang-14 -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/clang++-14 ${{ matrix.cmake-flags }} ..
run: mkdir build && cd build && cmake -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/clang-14 -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/clang++-14 ${{ matrix.cmake-flags }} ..
env:
SCCACHE_GHA_ENABLED: "true"
- name: build
working-directory: build
run: cmake --build . --parallel $(nproc)
env:
SCCACHE_GHA_ENABLED: "true"
- name: test
working-directory: build