-
Notifications
You must be signed in to change notification settings - Fork 62
205 lines (175 loc) · 6.76 KB
/
ci.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: CI
on:
push:
branches:
- master
paths-ignore:
- 'Documentation/**'
- 'LICENSE.txt'
- 'README.md'
pull_request:
branches:
- master
paths-ignore:
- 'Documentation/**'
- 'LICENSE.txt'
- 'README.md'
jobs:
format:
runs-on: ubuntu-latest
env:
CLANG_FORMAT_VERSION: 12
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
submodules: true
- name: Install package dependencies
run: sudo apt-get install -y clang-format-${{ env.CLANG_FORMAT_VERSION }}
- name: Set git configuration
run: git config --global clangFormat.binary clang-format-${{ env.CLANG_FORMAT_VERSION }}
- name: Check formatting (push to feature branch)
if: github.ref != 'refs/heads/master' && github.event_name == 'push'
run: Testing/script/gh_format.sh origin/master
- name: Check formatting (push to master branch or pull request merge)
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
run: Testing/script/gh_format.sh ${{ github.event.before }}
- name: Check formatting (pull request)
if: github.event_name == 'pull_request'
run: Testing/script/gh_format.sh origin/${{ github.base_ref }}
build-and-test:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
strategy:
fail-fast: false
matrix:
config:
- {
os: ubuntu-latest,
cc: gcc,
cxx: g++
}
- {
os: ubuntu-latest,
cc: clang,
cxx: clang++
}
- {
os: ubuntu-latest,
cc: icx,
cxx: icpx
}
- {
os: macos-latest,
cc: clang,
cxx: clang++
}
build_type: [Debug, RelWithDebInfo, Release]
libs: [shared]
plugins: [static_plugins]
include:
- config: {os: ubuntu-latest, cc: gcc, cxx: g++}
build_type: Debug
libs: static
plugins: static_plugins
- config: {os: ubuntu-latest, cc: gcc, cxx: g++}
build_type: Asan
libs: shared
plugins: static_plugins
- config: {os: ubuntu-latest, cc: gcc, cxx: g++}
build_type: Tsan
libs: shared
plugins: static_plugins
- config: {os: ubuntu-latest, cc: gcc, cxx: g++}
build_type: Ubsan
libs: shared
plugins: static_plugins
- config: {os: ubuntu-latest, cc: gcc, cxx: g++}
build_type: RelWithDebInfo
libs: shared
plugins: dynamic_plugins
runs-on: ${{ matrix.config.os }}
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
MERCURY_BUILD_CONFIGURATION: ${{ matrix.build_type }}
MERCURY_LIBS: ${{ matrix.libs }}
MERCURY_PLUGINS: ${{ matrix.plugins }}
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
INSTALL_DIR: install
ICX_COMPONENTS: intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mpi intel-oneapi-mpi-devel
steps:
- name: Set up hugepages
if: runner.os == 'Linux'
run: |
sudo sh -c "echo 32 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages"
grep Huge /proc/meminfo
- name: Fix kernel mmap rnd bits
if: runner.os == 'Linux'
# Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
# high-entropy ASLR in much newer kernels that GitHub runners are
# using leading to random crashes: https://reviews.llvm.org/D148280
run: sudo sysctl vm.mmap_rnd_bits=28
- name: Checkout source
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: true
- name: Setup compiler package dependencies
if: matrix.config.cc == 'icx'
run: |
Testing/script/gh_setup_intel_repo_${{ runner.os }}.sh
Testing/script/gh_get_pkg_deps_${{ runner.os }}.sh "$ICX_COMPONENTS" | tee icx_pkg_deps.txt
- name: Restore cached compiler package dependencies
id: cache-pkg-deps
if: matrix.config.cc == 'icx'
uses: actions/cache@v3
with:
path: |
/opt/intel/oneapi
key: ${{ runner.os }}-icx-${{ hashFiles('**/icx_pkg_deps.txt') }}-pkg-deps
- name: Install compiler package dependencies
if: matrix.config.cc == 'icx' && steps.cache-pkg-deps.outputs.cache-hit != 'true'
run: Testing/script/gh_install_pkg_deps_${{ runner.os }}.sh "$ICX_COMPONENTS"
- name: Install pkg-config
if: runner.os == 'macOS'
run: Testing/script/gh_install_pkg_deps_${{ runner.os }}.sh pkg-config
- name: Install MPI package dependencies
if: matrix.config.cc != 'icx'
run: Testing/script/gh_install_pkg_deps_${{ runner.os }}.sh mpich
- name: Restore cached dependencies
uses: actions/cache@v3
id: cache-deps
with:
path: ${{ runner.temp }}/${{ env.INSTALL_DIR }}
key: ${{ runner.os }}-${{ matrix.build_type }}-${{ matrix.config.cc }}-${{ hashFiles('Testing/script/gh_install_deps.sh') }}-deps
- name: Install dependencies (skip if cached)
if: steps.cache-deps.outputs.cache-hit != 'true'
run: Testing/script/gh_install_deps.sh
- name: Update
run: Testing/script/gh_ctest.sh update
- name: Configure
run: Testing/script/gh_ctest.sh configure
- name: Build
run: Testing/script/gh_ctest.sh build
- name: Test (skip for Asan/Tsan/Ubsan builds)
if: |
matrix.build_type != 'Asan' && matrix.build_type != 'Tsan' &&
matrix.build_type != 'Ubsan'
run: Testing/script/gh_ctest.sh test
- name: Coverage (Debug build only)
if: matrix.build_type == 'Debug' && matrix.config.cc == 'gcc'
run: Testing/script/gh_ctest.sh coverage
- name: Address Sanitizer (Asan build only)
if: matrix.build_type == 'Asan'
run: Testing/script/gh_ctest.sh memcheck
- name: Thread Sanitizer (Tsan build only)
if: matrix.build_type == 'Tsan'
run: Testing/script/gh_ctest.sh memcheck
- name: Undefined Behavior Sanitizer (Ubsan build only)
if: matrix.build_type == 'Ubsan'
run: Testing/script/gh_ctest.sh memcheck