-
-
Notifications
You must be signed in to change notification settings - Fork 162
93 lines (78 loc) · 2.71 KB
/
macos-clang-build.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
name: apple-clang++
on:
push:
branches:
- 'main'
paths-ignore:
- 'docs/**'
- '**/*.md'
- 'LICENSE'
workflow_dispatch:
pull_request:
jobs:
build:
runs-on: macos-14
name: ci-macos-14-apple-clang-18
env:
CLANG18_PATH: /opt/homebrew/opt/llvm@18/bin/clang
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install ccache
uses: hendrikmuhs/[email protected]
- name: Install clang
run: |
brew install llvm@18 \
&& echo 'export PATH="/opt/homebrew/opt/llvm@18/bin:$PATH"' >> /Users/runner/.bash_profile \
&& source /Users/runner/.bash_profile \
&& which clang++
- name: Cache Conan packages
id: cache-conan
uses: actions/[email protected]
env:
cache-name: cache-conan-packages
with:
path: ~/.conan2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('conanfile.txt') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Configure python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install Python dependencies
run: pip install -r .github/requirements.txt
- name: Configure Conan profile
run: |
CC=${{ env.CLANG18_PATH }} \
CXX=${{ env.CLANG18_PATH }}++ \
conan profile detect --force --name apple-clang-18
- name: Install Conan dependencies
run: |
conan install conanfile.txt \
-r conancenter \
-pr:b apple-clang-18 \
-pr:h apple-clang-18 \
-s compiler.cppstd=20 \
-s build_type=Debug \
-o "*:shared=True" \
-c:b tools.build:compiler_executables="{'c': '${{ env.CLANG18_PATH }}', 'cpp': '${{ env.CLANG18_PATH }}++'}" \
-c:h tools.build:compiler_executables="{'c': '${{ env.CLANG18_PATH }}', 'cpp': '${{ env.CLANG18_PATH }}++'}" \
--build=missing
- name: Configure CMake
run: |
cmake -S . --preset=unixlike-clang-debug \
-DBUILD_TESTING:BOOL=ON \
-DCMAKE_CXX_COMPILER=${{ env.CLANG18_PATH }}++ \
-DCMAKE_C_COMPILER=${{ env.CLANG18_PATH }} \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DUSE_STD_FORMAT:BOOL=ON \
-DUSE_SYSTEM_DEPENDENCIES:BOOL=ON \
-DCMAKE_TOOLCHAIN_FILE=build/Debug/generators/conan_toolchain.cmake
- name: Build
run: cmake --build --preset=unixlike-clang-debug
- name: Test
run: ctest --preset=unixlike-clang-debug