Skip to content

Commit

Permalink
feat(ci): cache CMake deps (sources and build)
Browse files Browse the repository at this point in the history
  • Loading branch information
berdal84 committed Nov 5, 2024
1 parent f3e7960 commit 97e7178
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ jobs:
env:
build_type: Release # possible options: MinSizeRel Release, Debug, RelWithDebInfo
steps:
- name: Git recursive checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true

- name: Install dependencies (Linux)
if: runner.os == 'Linux' # see https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context
run: sudo apt-get update && sudo apt-get install libegl1-mesa-dev libdbus-1-dev libgtk-3-dev
Expand All @@ -34,6 +28,34 @@ jobs:
if: runner.os == 'macOS' # see https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context
run: brew install mesalib-glw

- name: Git recursive checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true

- name: Cache CMake dependency source code
uses: actions/cache@v4
env:
cache-name: cache-cmake-dependency-sources
with:
path: ${{github.workspace}}/build/_deps/*-src
key: ${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
restore-keys: |
${{ env.cache-name }}-
- name: Cache CMake dependency build objects
uses: actions/cache@v4
env:
cache-name: cache-cmake-dependency-builds
with:
path: |
${{github.workspace}}/build/_deps/*-build
${{github.workspace}}/build/_deps/*-subbuild
key: ${{ env.cache-name }}-${{ matrix.os }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
restore-keys: |
${{ env.cache-name }}-${{ matrix.os }}
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
Expand Down

0 comments on commit 97e7178

Please sign in to comment.