-
Notifications
You must be signed in to change notification settings - Fork 58
72 lines (64 loc) · 1.98 KB
/
build-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
# Copyright (c) 2021-2024 Morwenn
# SPDX-License-Identifier: MIT
name: MacOS Builds
on:
push:
paths:
- '.github/workflows/build-macos.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'examples/**'
- 'include/**'
- 'tests/**'
pull_request:
paths:
- '.github/workflows/build-macos.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'examples/**'
- 'include/**'
- 'tests/**'
jobs:
build:
runs-on: macos-15
strategy:
fail-fast: false
matrix:
config:
# Release build
- cxx: g++-14
build_type: Release
- cxx: $(brew --prefix llvm@18)/bin/clang++
build_type: Release
# Debug builds
- cxx: g++-14
build_type: Debug
- cxx: $(brew --prefix llvm@18)/bin/clang++
build_type: Debug
sanitize: address
- cxx: $(brew --prefix llvm@18)/bin/clang++
build_type: Debug
sanitize: undefined
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: rui314/setup-mold@v1
- name: Configure CMake
working-directory: ${{runner.workspace}}
run: |
export CXX=${{matrix.config.cxx}}
cmake -H${{github.event.repository.name}} -Bbuild \
-DCMAKE_CONFIGURATION_TYPES=${{matrix.config.build_type}} \
-DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} \
-DCPPSORT_SANITIZE=${{matrix.config.sanitize}} \
-GNinja \
-DCPPSORT_BUILD_EXAMPLES=ON
- name: Build the test suite
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config ${{matrix.config.build_type}} -j 2
- name: Run the test suite
env:
CTEST_OUTPUT_ON_FAILURE: 1
working-directory: ${{runner.workspace}}/build
run: ctest -C ${{matrix.config.build_type}} --no-tests=error