-
Notifications
You must be signed in to change notification settings - Fork 67
224 lines (204 loc) · 6.93 KB
/
cpp.yaml
File metadata and controls
224 lines (204 loc) · 6.93 KB
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
name: C/C++ CI
on:
push:
branches:
- 'master'
- 'release/*'
pull_request:
paths-ignore:
- 'docs/**'
# Cancel any previous runs with the same key.
concurrency:
# Example key: Repository Structure CI-refs/pull/1381/merge
# or Repository Structure CI-<owner>-<sha> for pushes
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || format('{0}-{1}', github.repository_owner, github.sha) }}
cancel-in-progress: true
jobs:
# If this job becomes a required check, make sure to sync with `cpp_bypass.yaml`
do_cpp:
if: |
github.event_name != 'pull_request' ||
(
!contains(github.event.pull_request.body, '[no C++]')
)
runs-on: ubuntu-latest
steps:
- name: Info
run: echo "will build"
# If this job becomes a required check, make sure to sync with `cpp_bypass.yaml`
do_cpp_test:
needs:
- do_cpp
if: |
github.event_name != 'pull_request' ||
(
!contains(github.event.pull_request.body, '[no test]') &&
!contains(github.event.pull_request.body, '[no C++ test]')
)
runs-on: ubuntu-latest
steps:
- name: Info
run: echo "will build"
# Make sure to keep in sync with "lint" in `cpp_bypass.yaml`
lint:
needs: do_cpp
runs-on: ${{matrix.os}}
strategy:
matrix:
os:
- ubuntu-20.04
build_type:
- Debug
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
# We need history so that we have tags to provide version information.
fetch-depth: 0
# 0 fetches all history. See https://github.com/actions/checkout#checkout-v2
###
# Caching between builds
###
- name: Cache conan packages
uses: actions/cache@v2
with:
key: ${{matrix.os}}-conan-${{hashFiles('config/conanfile.py')}}
path: ~/.conan/data
###
# Install platform-level dependencies (OS-specific)
###
- name: Install dependencies
if: startsWith(matrix.os, 'ubuntu-')
run: |
sudo scripts/setup_ubuntu.sh
- name: Pre-build
run: mkdir -p $HOME/build
- name: Install C++ dependencies
run: .github/workflows/setup_conan_install.sh $HOME/build
- name: Check formating
run: CLANG_FORMAT=clang-format-12 scripts/check_cpp_format.sh .
- name: Check general text formatting
run: |
scripts/check_general_text_format.py lib* python/ config
- name: Check guards
run: |
scripts/check_ifndefs.py --root=$PWD lib*
- name: Check docs
run: .github/workflows/check_docs.sh $HOME/build
# Make sure to keep in sync with "build_and_test" in `cpp_bypass.yaml`
build_and_test:
needs: do_cpp_test
runs-on: ${{matrix.os}}
strategy:
matrix:
os:
- ubuntu-20.04
build_type:
- Debug
- Release
- Sanitizer
cxx:
- g++
- g++-9
- clang++-10
- clang++-12
# Only build and test the following configurations a subset of
# configurations to reduce the total number of concurrent jobs.
#
# The key "include" exists but only allows for the refinement of an
# existing matrix "job" (i.e., point in the product space) by adding
# more variables. Fallback to "exclude".
exclude:
# Ubuntu ({g++-9,clang++-10} [most])
- os: ubuntu-20.04
build_type: Sanitizer
cxx: g++
- os: ubuntu-20.04
build_type: Sanitizer
cxx: g++-9
- os: ubuntu-20.04
build_type: Debug
cxx: clang++-10
- os: ubuntu-20.04
build_type: Debug
cxx: clang++-12
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
# We need history so that we have tags to provide version information.
fetch-depth: 0
# 0 fetches all history. See https://github.com/actions/checkout#checkout-v2
###
# Caching between builds
###
- name: Cache conan packages
uses: actions/cache@v2
with:
key: ${{matrix.os}}-conan-${{hashFiles('config/conanfile.py')}}
path: ~/.conan/data
- name: Cache ccache objects
uses: actions/cache@v2
with:
key: ${{matrix.os}}-${{matrix.build_type}}-${{matrix.cxx}}-ccache-arrow-6-${{github.sha}}
restore-keys: |
${{matrix.os}}-${{matrix.build_type}}-${{matrix.cxx}}-ccache-arrow-6-
path: ~/.ccache
###
# Install platform-level dependencies (OS-specific)
###
- name: Install dependencies with CUDA
if: startsWith(matrix.os, 'ubuntu-') && (matrix.cxx=='g++' || (matrix.cxx=='clang++-12' && matrix.build_type=='Sanitizer'))
run: |
sudo scripts/setup_ubuntu.sh --with-cuda
- name: Install dependencies without CUDA
if: startsWith(matrix.os, 'ubuntu-') && (matrix.cxx!='g++' && (matrix.cxx!='clang++-12' || matrix.build_type!='Sanitizer'))
run: |
sudo scripts/setup_ubuntu.sh
- name: Install C++ dependencies
run: .github/workflows/setup_conan_install.sh $HOME/build
- name: Setup ccache
run: |
.github/workflows/configure_ccache.sh
ccache --max-files 350 --max-size=1.5G # Roughly two builds worth of objects, and limited in size as a safety net.
ccache --zero-stats
###
# Standard CMake build process
###
- name: Configure
run: |
GPU_ARGS=()
if [ "${{matrix.cxx}}" == "g++" ] || [ [ "${{matrix.cxx}}" == 'clang++-12' ] && [ "${{matrix.build_type}}" == "Sanitizer" ] ]
then
GPU_ARGS+=("-DCMAKE_CUDA_COMPILER_LAUNCHER=ccache")
GPU_ARGS+=("-DCMAKE_CUDA_ARCHITECTURES=75")
GPU_ARGS+=("-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc")
if [ "${{matrix.build_type}}" == "Sanitizer" ]; then
GPU_ARGS+=("-DCMAKE_LINKER=${{matrix.cxx}}")
fi
fi
.github/workflows/configure_cpp.sh \
${{matrix.os}} ${{matrix.cxx}} ${{matrix.build_type}} $HOME/build \
"${GPU_ARGS[@]}"
- name: Build
run: |
if [ "${{matrix.cxx}}" == "g++" ] || [ [ "${{matrix.cxx}}" == 'clang++-12' ] && [ "${{matrix.build_type}}" == "Sanitizer" ] ]
then
export CUDA_HOME=/usr/local/cuda
export C_INCLUDE_PATH=${CUDA_HOME}/include:${C_INCLUDE_PATH}
export LIBRARY_PATH=${CUDA_HOME}/lib64:$LIBRARY_PATH
fi
cmake --build $HOME/build --parallel 2
- name: Clean ccache
run: |
ccache --show-stats
ccache --cleanup
- name: Install
run: DESTDIR=/tmp cmake --install $HOME/build
- name: Test
if: startsWith(matrix.os, 'ubuntu-')
run: |
export AWS_EC2_METADATA_DISABLED=true
# Default timeout is 1500 seconds. Quick tests should not take more
# than a few seconds typically.
cd $HOME/build && ctest --output-on-failure --label-regex quick --parallel 2 --timeout 350