-
Notifications
You must be signed in to change notification settings - Fork 20
44 lines (36 loc) · 1.02 KB
/
cmake.yml
File metadata and controls
44 lines (36 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: CMake
on:
push:
branches:
- develop
pull_request:
branches:
- develop
env:
BUILD_TYPE: RelWithDebInfo
# CPM cache environment variable
CPM_SOURCE_CACHE: "${{ github.workspace }}/.cpm-cache"
jobs:
build:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v4
env:
cache-name: cache-cpm-modules
with:
path: |
${{ env.CPM_SOURCE_CACHE }}
key: ${{ runner.os }}-${{ env.BUILD_TYPE }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/CPM.cmake') }}
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}