-
-
Notifications
You must be signed in to change notification settings - Fork 159
99 lines (85 loc) · 2.99 KB
/
linux-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
94
95
96
97
98
99
name: clang++
on:
push:
branches:
- 'main'
paths-ignore:
- 'docs/**'
- '**/*.md'
- 'LICENSE'
workflow_dispatch:
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'
- 'LICENSE'
jobs:
build:
name: ci-ubuntu-24.04-clang-18-${{ matrix.type }}
runs-on: ubuntu-24.04
strategy:
matrix:
type: [static, shared]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install ccache
uses: hendrikmuhs/[email protected]
- 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 profiles
run: |
CC=clang-18 \
CXX=clang++-18 \
conan profile detect --force --name clang-18
- name: Install Conan dependencies
run: |
conan install conanfile.txt \
-r conancenter \
-pr:b clang-18 \
-pr:h clang-18 \
-s compiler.cppstd=20 \
-s build_type=Debug \
-o "*:shared=True" \
-c:b tools.build:compiler_executables="{'c': '/usr/bin/clang-18', 'cpp': '/usr/bin/clang++-18'}" \
-c:h tools.build:compiler_executables="{'c': '/usr/bin/clang-18', 'cpp': '/usr/bin/clang++-18'}" \
--build=missing \
- name: Configure CMake
run: |
cmake -S ${{github.workspace}} --preset=unixlike-clang-debug-${{ matrix.type }} \
-DCMAKE_C_COMPILER=/usr/bin/clang-18 \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++-18 \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_TESTING:BOOL=ON \
-DBUILD_EXAMPLES:BOOL=ON \
-DUSE_SYSTEM_DEPENDENCIES:BOOL=ON \
-DUSE_STD_FORMAT:BOOL=ON \
-DCMAKE_TOOLCHAIN_FILE=build/Debug/generators/conan_toolchain.cmake \
-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld
- name: Build
run: cmake --build --preset=unixlike-clang-debug-${{ matrix.type }}
- name: Test
run: ctest --preset=unixlike-clang-debug-${{ matrix.type }}
- name: Install
run: cmake --build --preset=unixlike-clang-debug-${{ matrix.type }} --target install
- name: Examples
run: |
cmake --build --preset=unixlike-clang-debug-${{ matrix.type }} --target run-faker-cxx-basic-example \
&& cmake --build --preset=unixlike-clang-debug-${{ matrix.type }} --target run-faker-cxx-person-example