-
Notifications
You must be signed in to change notification settings - Fork 0
301 lines (268 loc) · 7.94 KB
/
linux-clang.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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# GitHub Actions Workflow
# Build with Clang on Linux
# Copyright 2019-2025 kaoru https://www.tetengo.org/
name: Linux - Clang
on:
workflow_dispatch:
push:
branches: [ main ]
tags: [ v* ]
pull_request:
branches: [ main ]
env:
CONCURRENT_BUILD: 4
CLANG_COMMAND: clang-14
CLANGXX_COMMAND: clang++-14
DOXYGEN_VER: 1.13.0
DOXYGEN_CACHE_REV: 0
BOOST_VER: 1_87_0
BOOST_VER_DOT: 1.87.0
BOOST_BOOTSTRAP_TOOLSET: clang
BOOST_TOOLSET: clang-14
BOOST_CACHE_REV: 0
jobs:
doxygen_build:
name: Doxygen Build
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
shell: bash
run: |
if [ ! -e .doxygen_build/doxygen-${{ env.DOXYGEN_VER }}/build/.build_finished ];
then
sudo apt-get -y update
sudo apt-get -y install \
bison \
cmake \
flex
fi
- name: Cache Doxygen build
uses: actions/cache@v4
with:
path: .doxygen_build
key: Linux-Clang-Doxygen-${{ env.DOXYGEN_VER }}-${{ env.DOXYGEN_CACHE_REV }}
- name: Build Doxygen
shell: bash
run: |
if [ ! -e .doxygen_build/doxygen-${{ env.DOXYGEN_VER }}/build/.build_finished ];
then
mkdir -p .doxygen_build
cd .doxygen_build
wget http://doxygen.nl/files/doxygen-${{ env.DOXYGEN_VER }}.src.tar.gz
tar -xf doxygen-${{ env.DOXYGEN_VER }}.src.tar.gz
mkdir -p doxygen-${{ env.DOXYGEN_VER }}/build
cd doxygen-${{ env.DOXYGEN_VER }}/build
cmake -G "Unix Makefiles" ..
make -j ${{ env.CONCURRENT_BUILD }}
touch .build_finished
fi
boost_build:
name: Boost Build
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
shell: bash
run: |
sudo apt-get -y update
sudo apt-get -y install \
clang-14
- name: Cache Boost build
uses: actions/cache@v4
with:
path: .boost_build
key: Linux-Clang-Boost-${{ env.BOOST_VER }}-${{ env.BOOST_CACHE_REV }}
- name: Build Boost
shell: bash
run: |
if [ ! -e .boost_build/boost_${{ env.BOOST_VER }}/.build_finished ];
then
mkdir -p .boost_build
cd .boost_build
curl -L -o boost_${{ env.BOOST_VER }}.tar.bz2 https://archives.boost.io/release/${{ env.BOOST_VER_DOT }}/source/boost_${{ env.BOOST_VER }}.tar.bz2
tar -xf boost_${{ env.BOOST_VER }}.tar.bz2
cd boost_${{ env.BOOST_VER }}
./bootstrap.sh --with-toolset=${{ env.BOOST_BOOTSTRAP_TOOLSET }}
(./b2 -j ${{ env.CONCURRENT_BUILD }} toolset=${{ env.BOOST_TOOLSET }} variant=release link=static || :)
touch .build_finished
fi
doxygen:
name: Doxygen
runs-on: ubuntu-22.04
needs: doxygen_build
steps:
- name: Install dependencies
shell: bash
run: |
sudo apt-get -y update
sudo apt-get -y install \
autoconf-archive \
clang-13 \
clang-14 \
dos2unix \
graphviz \
iwyu
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Restore Doxygen build
uses: actions/cache@v4
with:
path: .doxygen_build
key: Linux-Clang-Doxygen-${{ env.DOXYGEN_VER }}-${{ env.DOXYGEN_CACHE_REV }}
- name: Install Doxygen
shell: bash
run: |
cd .doxygen_build/doxygen-${{ env.DOXYGEN_VER }}/build
sudo make -j ${{ env.CONCURRENT_BUILD }} install
- name: Configure
shell: bash
run: |
export DISTCHECK_CONFIGURE_FLAGS=" \
CC=${{ env.CLANG_COMMAND }} \
CXX=${{ env.CLANGXX_COMMAND }} \
"
./bootstrap.sh
mkdir -p .doxygen
cd .doxygen
../configure $DISTCHECK_CONFIGURE_FLAGS
- name: Cache documents
uses: actions/cache@v4
with:
path: .doxygen/doc
key: Linux-Clang-documents-${{ github.run_number }}
- name: Make documents
shell: bash
run: |
cd .doxygen
make doc
lint:
name: Lint
runs-on: ubuntu-22.04
needs: boost_build
steps:
- name: Install dependencies
shell: bash
run: |
sudo apt-get -y update
sudo apt-get -y install \
autoconf-archive \
clang-13 \
clang-14 \
dos2unix \
graphviz \
iwyu
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Restore Boost build
uses: actions/cache@v4
with:
path: .boost_build
key: Linux-Clang-Boost-${{ env.BOOST_VER }}-${{ env.BOOST_CACHE_REV }}
- name: Install Boost
shell: bash
run: |
cd .boost_build/boost_${{ env.BOOST_VER }}
(sudo ./b2 -j ${{ env.CONCURRENT_BUILD }} toolset=${{ env.BOOST_TOOLSET }} variant=release link=static install --prefix=/usr/local || :)
- name: Configure
shell: bash
run: |
export DISTCHECK_CONFIGURE_FLAGS=" \
CC=${{ env.CLANG_COMMAND }} \
CXX=${{ env.CLANGXX_COMMAND }} \
"
./bootstrap.sh
mkdir -p .lint
cd .lint
../configure $DISTCHECK_CONFIGURE_FLAGS
- name: Lint
shell: bash
run: |
cd .lint
make -j ${{ env.CONCURRENT_BUILD }} iwyu
build:
name: Build
runs-on: ubuntu-22.04
needs: boost_build
steps:
- name: Install dependencies
shell: bash
run: |
sudo apt-get -y update
sudo apt-get -y install \
autoconf-archive \
clang-13 \
clang-14 \
dos2unix \
graphviz \
iwyu
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Restore Boost build
uses: actions/cache@v4
with:
path: .boost_build
key: Linux-Clang-Boost-${{ env.BOOST_VER }}-${{ env.BOOST_CACHE_REV }}
- name: Install Boost
shell: bash
run: |
cd .boost_build/boost_${{ env.BOOST_VER }}
(sudo ./b2 -j ${{ env.CONCURRENT_BUILD }} toolset=${{ env.BOOST_TOOLSET }} variant=release link=static install --prefix=/usr/local || :)
- name: Configure
shell: bash
run: |
export DISTCHECK_CONFIGURE_FLAGS=" \
CC=${{ env.CLANG_COMMAND }} \
CXX=${{ env.CLANGXX_COMMAND }} \
"
./bootstrap.sh
mkdir -p .build
cd .build
../configure $DISTCHECK_CONFIGURE_FLAGS
- name: Cache archives
uses: actions/cache@v4
with:
path: .build/tetengo-*
key: Linux-Clang-archives-${{ github.run_number }}
- name: Build and make archives
shell: bash
run: |
export DISTCHECK_CONFIGURE_FLAGS=" \
CC=${{ env.CLANG_COMMAND }} \
CXX=${{ env.CLANGXX_COMMAND }} \
"
export BOOST_TEST_LOG_LEVEL=warning
cd .build
make -j ${{ env.CONCURRENT_BUILD }} distcheck
make -j ${{ env.CONCURRENT_BUILD }} dist-bzip2
make -j ${{ env.CONCURRENT_BUILD }} dist-zip
artifact:
name: Artifact Collection
runs-on: ubuntu-22.04
needs: [ doxygen, build ]
steps:
- name: Restore documents
uses: actions/cache@v4
with:
path: .doxygen/doc
key: Linux-Clang-documents-${{ github.run_number }}
- name: Restore archives
uses: actions/cache@v4
with:
path: .build/tetengo-*
key: Linux-Clang-archives-${{ github.run_number }}
- name: Move artifacts
shell: bash
run: |
mkdir artifacts
mv .doxygen/doc artifacts
mv .build/tetengo-* artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts-linux
path: artifacts