-
Notifications
You must be signed in to change notification settings - Fork 49
132 lines (116 loc) · 3.72 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: macOS
on:
push:
branches:
- master
- v*/dev
- ci/*
paths:
- '.github/workflows/macos.yml'
- 'benchmark/**'
- 'cmake/**'
- 'examples/**'
- 'include/**'
- 'src/**'
- 'tests/unittests/**'
- '**/CMakeLists.txt'
pull_request:
branches:
- master
- v*/dev
- ci/*
paths:
- '.github/workflows/macos.yml'
- 'benchmark/**'
- 'cmake/**'
- 'examples/**'
- 'include/**'
- 'src/**'
- 'tests/unittests/**'
- '**/CMakeLists.txt'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}-${{ github.event.schedule }}
cancel-in-progress: true
env:
CCACHE_ABSSTDERR: true
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_DIR: "/tmp/ccache"
CCACHE_MAXSIZE: 50M
CCACHE_NOHASHDIR: true
CCACHE_SLOPPINESS: "pch_defines,time_macros"
CCACHE_UNIFY: true
jobs:
build:
runs-on: macos-${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ 14 ]
cxx: [ brew-clang++, clang++, g++-14, g++-13, g++-12 ]
std: [ 17 ]
include:
# brew-clang++ with later standards on macos 14
- os: 14
cxx: brew-clang++
std: 20
- os: 14
cxx: brew-clang++
std: 23
# macos 15 with built-in clang++ and brew-clang++
- os: 15
cxx: clang++
std: 17
- os: 15
cxx: brew-clang++
std: 17
env:
CXX: ${{ matrix.cxx }}
OS: ${{ matrix.os }}
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create Build Environment
run: |
mkdir ${{ runner.workspace }}/build
brew install --overwrite ccache
- name: Setup Homebrew clang
if: ${{ matrix.cxx == 'brew-clang++' }}
run: |
llvm_root="$(brew --prefix llvm)"
echo "${llvm_root}/bin" >> $GITHUB_PATH
echo "CXX=clang++" >> $GITHUB_ENV
echo "LDFLAGS=-Wl,-rpath,${llvm_root}" >> $GITHUB_ENV
echo "CPPFLAGS=-isystem ${llvm_root}/include" >> $GITHUB_ENV
echo "CXXFLAGS=-isystem ${llvm_root}/include/c++/v1" >> $GITHUB_ENV
- name: Load ccache
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ github.workflow }}-macos${{ matrix.os }}-${{ matrix.cxx }}-std${{ matrix.std }}-${{ github.sha }}
restore-keys: |
ccache-${{ github.workflow }}-macos${{ matrix.os }}-${{ matrix.cxx }}-std${{ matrix.std }}-${{ github.ref }}
ccache-${{ github.workflow }}-macos${{ matrix.os }}-${{ matrix.cxx }}-std${{ matrix.std }}-${{ github.base_ref }}
ccache-${{ github.workflow }}-macos${{ matrix.os }}-${{ matrix.cxx }}-std${{ matrix.std }}
- name: Setup ccache
run: |
ccache --version
ccache --zero-stats
ccache --show-stats
ccache --show-config
- name: Run CMake
working-directory: ${{ runner.workspace }}/build
run: |
cmake -DSCN_CI=ON -DCMAKE_CXX_STANDARD=${{ matrix.std }} $GITHUB_WORKSPACE
- name: Build
working-directory: ${{ runner.workspace }}/build
run: cmake --build . --parallel -- -k
- name: Show ccache stats
run: |
ccache --show-stats
- name: Test
working-directory: ${{ runner.workspace }}/build
run: ctest --output-on-failure