-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (90 loc) · 2.91 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
name: MacOS
on:
push:
paths:
# Workflow file itself
- '.github/workflows/MacOS.yml'
# C++ files
- '**.cpp'
- '**.hpp'
# CMake files
- '**.cmake'
- '**.txt'
branches-ignore:
- 'dependabot/**'
pull_request:
branches:
- main
- develop
release:
types: [published]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CMAKE_C_COMPILER_LAUNCHER: "ccache"
CMAKE_CXX_COMPILER_LAUNCHER: "ccache"
jobs:
Build:
runs-on: macos-14
strategy:
fail-fast: false
matrix:
cfg:
#- { compiler: gcc, compiler_version: "12" }
- { compiler: clang, compiler_version: "15.4" }
build_type:
- "Debug"
- "Release"
dynamic_test:
- "none"
- "asan"
- "tsan"
- "ubsan"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ runner.os }}-${{ matrix.cfg.compiler }}-${{ matrix.cfg.compiler_version }}
- name: Setup XCode
if: matrix.cfg.compiler == 'clang'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.cfg.compiler_version }}
- name: Setup Environment
run: external/Phi/scripts/ci/SetupEnvironment.sh
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
- name: Install ninja
run: brew install ninja
- name: Install dependencies
run: pip install wheel jinja2
- name: Install
run: |
if [ "${{ matrix.cfg.compiler }}" = "gcc" ]; then
brew install gcc@${{ matrix.cfg.compiler_version }}
echo "CC=gcc-${{ matrix.cfg.compiler_version }}" >> $GITHUB_ENV
echo "CXX=g++-${{ matrix.cfg.compiler_version }}" >> $GITHUB_ENV
elif [ "${{ matrix.cfg.compiler}}" = "clang" ]; then
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
fi
- name: Configure build directory
run: |
mkdir build -p
cd build
cmake -DCMAKE_BUILD_TYPE:STRING=${{ matrix.build_type }} -DCMAKE_CXX_FLAGS:STRING="-DDLXEMU_VERIFY_UNDO_REDO -DDLXEMU_VERIFY_COLUMN" -DDLXEMU_ENABLE_ASAN:BOOL=${{ matrix.dynamic_test == 'asan' }} -DDLXEMU_ENABLE_LSAN:BOOL=${{ matrix.dynamic_test == 'lsan' }} -DDLXEMU_ENABLE_TSAN:BOOL=${{ matrix.dynamic_test == 'tsan' }} -DDLXEMU_ENABLE_UBSAN:BOOL=${{ matrix.dynamic_test == 'ubsan' }} ..
- name: Build
working-directory: ./build
run: cmake --build . --config ${{ matrix.build_type }}
- name: Run tests
working-directory: ./build
run: ctest . -C ${{ matrix.build_type }}