-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (40 loc) · 1003 Bytes
/
cmake-macos.yml
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
45
46
47
48
name: MacOS Build
on:
push:
branches:
- master
jobs:
build-and-test:
strategy:
matrix:
os: [ macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install packages
run: |
brew install cmake ccache
- name: Configure build
run: |
export CCACHE_BASEDIR="${HOME}/.ccache/$(date +%Y%m%d-%H%M%S)"
export CC="ccache gcc"
export CXX="ccache g++"
mkdir -p build
cd build
cmake ..
- name: Build project
run: |
cd build
make
- name: Run tests
run: |
cd build
ctest --output-on-failure
- name: Cache ccache
uses: actions/cache@v2
with:
path: ${{ env.HOME }}/.ccache
key: ${{ runner.os }}-ccache-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-ccache-