-
Notifications
You must be signed in to change notification settings - Fork 1
297 lines (261 loc) · 9.94 KB
/
automate_build_of_repo.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
name: multiarch build on dispatch
on:
workflow_dispatch:
schedule:
- cron: "17 1 * * *" ## at 01:17
jobs:
build:
name: Build
continue-on-error: false
strategy:
matrix:
target:
# - id: 'linux-amd64-distribution'
# os: 'ubuntu-latest'
# tar_extra_args: ''
# llvm_version: '18.x'
# build_target: 'distribution'
- id: 'linux-amd64'
os: 'ubuntu-24.04'
tar_extra_args: ''
# - id: 'linux-aarch64'
# os: "ubuntu-latest"
# os: ['self-hosted', 'linux', 'ARM64']
# - id: 'linux-riscv64'
# os: "ubuntu-latest"
# os: ['self-hosted', 'linux', 'RISCV64']
## https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/
- id: 'darwin-amd64'
os: 'macos-14'
tar_extra_args: ''
- id: 'windows-amd64'
os: 'windows-2022'
# When unpacking an archive on Windows, the symlinks can't be
# created unless the target path already exists. This causes
# problems when the linked file is ordered after the link
# inside the archive. Dereferencing the files when packing them
# adds an additional copy per link, but it reliably works and
# the additional size is not too large on Windows.
tar_extra_args: '--dereference'
# llvm_version: ['17.x']
fail-fast: true
runs-on: ${{ matrix.target.os }}
steps:
- name: Check out the code
uses: actions/checkout@v4
with:
fetch-depth: 2
repository: Haldir65/ronan
token: ${{ secrets.ACCESS_TOKEN }}
ref: 'master'
path: ronan
- name: Cache Boost artifact
id: cache-boost
uses: actions/cache@v4
with:
path: ronan/cmake/vendor/boost-1.85.0-cmake.tar.xz
key: ${{ runner.os }}-boost-1.85.0
- name: Retrieve boost cache
if: steps.cache-boost.outputs.cache-hit != 'true'
run: echo "boost cache is not found locally"
- name: Cache build cache
id: cache-deps
uses: actions/cache@v4
with:
path: ronan/build/_deps
key: ${{ runner.os }}-build_deps-v1
# - name: Install LLVM and Clang on linux
# if: startsWith(matrix.target.id, 'linux-')
# uses: KyleMayes/install-llvm-action@v2
# with:
# version: "17.0"
- name: Install `ninja` on Ubuntu
if: startsWith(matrix.target.id, 'linux-')
shell: bash
run: |
clang --version
sudo apt install ninja-build build-essential coreutils tree libtbb-dev -y
echo "cpu core num is "
nproc
- name: Install `ninja llvm cmake ` on macOS
if: startsWith(matrix.target.id, 'darwin-')
shell: bash
run: |
brew install ninja llvm tree
clang --version
echo "BREW_INSTALL_PREFIX=$(brew --prefix llvm)" >> $GITHUB_ENV
echo "${BREW_INSTALL_PREFIX}/bin"
echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH
clang --version
echo "llvm"
/opt/homebrew/opt/llvm/bin/clang --version
- name: Build (mac or linux)
if: startsWith(matrix.target.id, 'linux-') || startsWith(matrix.target.id, 'darwin-')
shell: bash
working-directory: ronan
run: |
chmod +x ./scripts/build.sh
./scripts/build.sh
- name: Build (Windows)
if: matrix.target.id == 'windows-amd64'
working-directory: ronan
shell: |
powershell -Command "& '{0}'"
run: |
./scripts/build.ps1
- name: show layouts (unix)
if: startsWith(matrix.target.id, 'linux-') || startsWith(matrix.target.id, 'darwin-')
shell: bash
working-directory: ronan
run: |
tree -L 3 build
- name: Inspect
shell: bash
working-directory: ronan
run: |
# for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# do
# echo "Mendax Current number: $i"
# if [[ "${{ matrix.target.id }}" == 'windows-amd64' ]]; then
# PATH=build/apps/Release:$PATH main.exe --verbose true --filename "cmake/hello/resources/twitter.json" --dir "cmake/hello/resources" --mode $i
# else
# ASAN_OPTIONS=alloc_dealloc_mismatch=0 PATH=build/apps:$PATH main --verbose true --filename "cmake/hello/resources/twitter.json" --dir "cmake/hello/resources" --mode $i
# fi
# done
if [[ "${{ matrix.target.id }}" == 'windows-amd64' ]]; then
powershell -executionpolicy bypass -File scripts/test.ps1
else
bash scripts/test.sh
fi
# - name: run benchmark
# # if: startsWith(matrix.target.id, 'darwin-') || startsWith(matrix.target.id, 'linux-')
# shell: bash
# working-directory: ronan
# run: |
# bash scripts/run_benchmark.sh
# - name: Zip
# shell: bash
# run: |
# mkdir -p dist
# if [[ "${{ matrix.target.id }}" == 'windows-amd64' ]]; then
# tar -cvzf dist/main-${{ matrix.target.id }}.tar.gz -C build/apps/Release main.exe
# else
# tar -cvzf dist/main-${{ matrix.target.id }}.tar.gz -C build/apps main
# fi
# - name: Upload Artifacts
# uses: actions/upload-artifact@v4
# with:
# name: ${{ matrix.target.id }}-main
# path: dist
# if-no-files-found: error
# retention-days: 7
dockerBuild:
name: Build project in docker container
# if: "contains(github.event.head_commit.message, '[atomated]')"
continue-on-error: false
runs-on: ubuntu-latest
strategy:
matrix:
container: [ "silkeh/clang:18-bookworm" ,
"haldir65/hello-docker-hub:clang17-cmake3.28",
"haldir65/hello-docker-hub:clang19-cmake3.28",
"ubuntu:24.04"
]
container:
image: docker://${{ matrix.container }}
steps:
- name: Check out the code
uses: actions/checkout@v4
with:
fetch-depth: 2
repository: Haldir65/ronan
token: ${{ secrets.ACCESS_TOKEN }}
ref: 'master'
path: ronan
- name: Cache Boost artifact
id: cache-boost
uses: actions/cache@v4
with:
path: ronan/cmake/vendor/boost-1.85.0-cmake.tar.xz
key: ${{ runner.os }}-boost-1.85.0
- name: Retrieve boost cache
if: steps.cache-boost.outputs.cache-hit != 'true'
run: echo "boost cache is not found locally"
- name: Cache build cache
id: cache-deps
uses: actions/cache@v4
with:
path: ronan/build/_deps
key: ${{ runner.os }}-build_deps-v1
- name: install dependency on debian
shell: bash
run: |
apt update
apt install -y sudo ninja-build git unzip build-essential tree checkinstall zlib1g-dev libtbb-dev wget
- name: install latest version of cmake
shell: bash
# if: matrix.container == 'silkeh/clang:17-bookworm' || matrix.container == 'ubuntu:24.04'
run: |
wget -qO- "https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local
/usr/local/bin/cmake --version
echo $PATH
which cmake
cmake --version
- name: Show clang version
shell: bash
if: matrix.container != 'gcc:13.2.0' && matrix.container != 'ubuntu:24.04'
run: |
clang --version
cmake --version
which clang
which cmake
- name: Show compiler info [gcc]
shell: bash
run: |
gcc --version
g++ --version
which gcc
- name: Build in docker conatiners
shell: bash
working-directory: ronan
run: |
chmod +x ./scripts/build.sh
./scripts/build.sh
- name: show layouts
shell: bash
working-directory: ronan
run: |
tree -L 3 build
# https://twitter.com/zeuxcg/status/1769957028167111096
- name: work round for address sanitizer
if: startsWith(matrix.container, 'haldir65/hello-docker-hub')
shell: bash
run: |
sysctl -w vm.mmap_rnd_bits=28
- name: Inspect
shell: bash
working-directory: ronan
run: |
# for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# do
# echo "Mendax Current number: $i"
# ASAN_OPTIONS=alloc_dealloc_mismatch=0 PATH=build/apps:$PATH main --verbose true --filename "cmake/hello/resources/twitter.json" --dir "cmake/hello/resources" --mode $i
# done
bash scripts/test.sh
# - name: run benchmark
# shell: bash
# working-directory: ronan
# run: |
# bash scripts/run_benchmark.sh
# - name: Zip
# shell: bash
# run: |
# mkdir -p dist
# tar -cvzf dist/main-app.tar.gz -C build/apps main
# - name: Upload Artifacts
# uses: actions/upload-artifact@v4
# with:
# name: app-main
# path: dist
# if-no-files-found: error
# retention-days: 7