forked from radareorg/radare2
-
Notifications
You must be signed in to change notification settings - Fork 0
459 lines (452 loc) · 15 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
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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
name: CI
on:
push:
branches:
- master
pull_request:
# schedule:
# - cron: '0 0 * * 1'
jobs:
build-offline:
name: linux-offline
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Building r2 without network access
run: |
./preconfigure
echo UNPLUG
sudo rm -f /etc/resolv.conf || true
ping av.com || true
./configure --with-rpath --prefix=/usr
make -j ; sudo make install
build-oldlibs:
name: linux-acr-oldlibsbug
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setting up bad libnames
run: |
mkdir -p /tmp/fakelibs /tmp/fakeincs
for a in anal asm cons crypto flag hash lang parse reg search syscall util ; do touch /tmp/fakelibs/libr_$a.a ; touch /tmp/fakelibs/libr_$a.so ; done
touch /tmp/fakeincs/r_util.h
chmod 000 /tmp/fakelibs/*
export CFLAGS=-I/tmp/fakeincs/
export LDFLAGS=-L/tmp/fakelibs/
sys/install.sh
build-nocs:
name: linux-nocs
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Building without capstone
run: |
cp -f dist/plugins-cfg/plugins.nocs.cfg plugins.cfg
./configure --without-capstone && make -j
build-wasi:
name: linux-wasi
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Installing with symlinks
run: |
sys/wasi.sh
- name: Extract r2 version
run: echo "##[set-output name=branch;]$( cd sys;python version.py )"
id: r2v
- uses: actions/upload-artifact@v2
with:
name: radare2-${{ steps.r2v.outputs.branch }}-wasi.zip
path: radare2-*-wasi.zip
build-acr-gperf:
name: linux-acr-gperf
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install meson ninja r2pipe wget
sudo apt install gperf
- name: Installing with symlinks
run: |
export CFLAGS="-O2 -Werror -Wno-unused-result -Wno-stringop-truncation"
sys/install.sh
- name: Running tests
run: r2r test/db/cmd
build-resymlink:
name: linux-acr-resymlink
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Installing with symlinks
run: |
export CFLAGS="-O2 -Werror -Wno-unused-result -Wno-stringop-truncation"
sys/install.sh
- name: Uninstalling
run: sudo make uninstall
- name: Reinstalling without symlinks
run: sudo make install
build-rpath-linux:
if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
name: linux-rpath
continue-on-error: true
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: build and run
run: |
# test and build rpath installation
export CFLAGS=-O0
./configure --prefix=/tmp --with-rpath
make -j
make install
ldd /tmp/bin/r2
/tmp/bin/r2 -v
/tmp/bin/rabin2 -l /tmp/bin/r2
build-rpath-macos:
if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
name: macos-rpath
continue-on-error: true
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: build and run
run: |
# test and build rpath installation
export CFLAGS=-O0
./configure --prefix=/tmp --with-rpath
make -j
make install
/tmp/bin/r2 -v
/tmp/bin/rabin2 -l /tmp/bin/r2
build-spaces:
name: linux-meson-spaces
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
#- name: XXX this is not possible with make Install from a directory with spaces
# run: |
# git config pull.rebase false
# git clone --depth 1 https://github.com/radareorg/radare2 "spa ces" ; cd "spa ces" ; ./sys/install.sh > /dev/null ; cd ..
# r2 -v
# - name: Install to a directory with spaces using ACR/MAKE
# run: |
# git config --global pull.rebase false
# git clone --depth 1 https://github.com/radareorg/radare2
# cd radare2
# ./configure --prefix=/usr/local; make uninstall
# ./configure --prefix=/usr; make uninstall
# ./sys/install.sh "/usr/spa ces" > /dev/null
# LD_LIBRARY_PATH="/usr/spa ces/lib" PATH="/usr/spa ces/bin:$PATH" r2 -v
# cd ..
- name: Build on a directory with spaces (meson only)
run: |
export PATH=${HOME}/.local/bin:${HOME}/Library/Python/3.9/bin:${PATH}
sudo apt-get --assume-yes install python3-wheel gperf python3-setuptools cabextract gperf
sudo pip3 install meson ninja
git config --global pull.rebase false
git clone --depth 1 . "spa ces"
cd "spa ces"
export CFLAGS="-O2 -Werror -Wno-unused-result -Wno-stringop-truncation"
meson --prefix="/tmp/r 2" build
ninja -C build
ninja -C build install
cd ..
find "/tmp/r 2"
LD_LIBRARY_PATH="/tmp/r 2/lib/x86_64-linux-gnu/" "/tmp/r 2/bin/r2" -v
linux-static:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Installing the musl runtime
run: |
sudo apt install musl-tools
- name: Building static r2 with acr
run: |
cp -f dist/plugins-cfg/plugins.static.nogpl.cfg plugins.cfg
NOLTO=1 sys/static.sh
# NOLTO=1 sys/static.sh
make -C binr/blob
tar cJvf r2-static.tar.xz r2-static
- name: Extract r2 version
run: echo "##[set-output name=branch;]$( cd sys;python version.py )"
id: r2v
- name: Pub
uses: actions/upload-artifact@v2
with:
name: radare2-${{ steps.r2v.outputs.branch }}-static.tar.xz
path: r2-static.tar.xz
- name: Static static r2 with meson
run: |
sudo apt-get --assume-yes install python3-wheel python3-setuptools cabextract gperf
sudo pip3 install meson ninja
CFLAGS="-static" LDFLAGS="-static" meson --prefix=${HOME}/.local --buildtype release --default-library static build
ninja -C build && ninja -C build install
linux-acr-deb-64:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Packaging for Debian
run: sys/debian.sh
- name: Extract r2 version
run: echo "##[set-output name=branch;]$( cd sys; python version.py )"
id: r2v
- name: Pub
uses: actions/upload-artifact@v2
with:
name: radare2_${{ steps.r2v.outputs.branch }}-debian_amd64.zip
path: dist/debian/*/*.deb
linux-acr-deb-32:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Packaging for 32bit Debian
run: |
sudo apt install gcc-multilib gperf
export CFLAGS=-m32
export LDFLAGS=-m32
export ARCH=i386
sys/debian.sh
- name: Extract r2 version
run: echo "##[set-output name=branch;]$( cd sys;python version.py )"
id: r2v
- name: Pub
uses: actions/upload-artifact@v2
with:
name: radare2_${{ steps.r2v.outputs.branch }}-debian_i386.zip
path: dist/debian/*/*.deb
## RPM PACKAGES DISABLED
# linux-meson-rpm:
# runs-on: ubuntu:18.04
# container: centos:8
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Prepare Skeleton
# run: |
# mkdir -p SOURCES SPECS
# cp -f dist/rpm/*spec SPECS
# wget -O https://github.com/radareorg/radare2/archive/master/radare2-5.1.0-git.tar.gz
# - name: rpmbuild
# uses: robertdebock/[email protected]
# - name: Pub
# uses: actions/upload-artifact@v2
# with:
# path: RPMS/*/*.rpm *.rpm dist/rpm/*.rpm
# centos-meson-rpm:
# runs-on: ubuntu:18.04
# container: centos:8
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Install tools for CentOS:8
# run: |
# yum install -y patch unzip git gcc make python38 python38-pip rpm-build rpmdevtools wget
# pip3.8 install meson ninja r2pipe
# - name: Building with Meson
# run: |
# meson build
# ninja -C build
# ninja -C build install
# - name: RPM Packaging
# run: |
# cp -f dist/rpm/radare2.spec .
# rpmdev-setuptree
# mkdir -p rpmbuild/SOURCES
# cd rpmbuild/SOURCES
# wget https://github.com/radareorg/radare2/archive/5860c3efc12d4b75e72bdce4b1d3834599620913/radare2-5.1.0-git.tar.gz
# cd -
# rpmbuild -ba radare2.spec
# - name: Pub
# uses: actions/upload-artifact@v2
# with:
# path: rpmbuild/RPMS/*/*.rpm
linux-asan-fuzz:
runs-on: ubuntu-20.04
continue-on-error: true
if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Building Radare2
run: |
pip install r2pipe
sys/sanitize.sh
- name: Installing tools for the testsuite
run: sudo apt-get --assume-yes install python3-wheel python3-setuptools cabextract gperf
- name: Running tests
run: |
export ASAN_OPTIONS=detect_leaks=0
export R2R_SKIP_ARCHOS=1
export LD_LIBRARY_PATH=/usr/local/lib
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.5
make tests
- name: Run fuzz tests
run: |
export ASAN_OPTIONS=detect_leaks=0
export R2R_SKIP_ARCHOS=1
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.5
make -C test fuzz-tests
linux-test:
runs-on: ubuntu-20.04
# if: contains(github.ref, 'ci-')
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Building Radare2
run: |
pip install r2pipe wheel
export CFLAGS="-O2 -Wno-unused-result"
sys/install.sh
- name: Running tests
run: |
export LD_LIBRARY_PATH=/usr/local/lib
make tests
# Apple
macos-acr:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Packaging
run: dist/macos/build-pkg.sh
- name: Extract r2 version
run: echo "##[set-output name=branch;]$( python sys/version.py )"
id: r2v
# - name: Building Radare2
# run: |
# export CFLAGS="-O2" # -Werror -Wno-unused-result -Wno-unicode -Wno-unneeded-internal-declaration"
# sys/install.sh && make -C dist/macos
- name: Pub
uses: actions/upload-artifact@v2
with:
path: dist/macos/*.pkg
name: radare2-${{ steps.r2v.outputs.branch }}_macos.pkg
# macos-acr-m1:
# runs-on: macos-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Packaging
# run: export CC="xcrun --sdk macosx11.1 gcc -arch arm64" ; dist/macos/build-pkg.sh
# - name: Extract r2 version
# run: echo "##[set-output name=branch;]$( python sys/version.py )"
# id: r2v
# - name: Pub
# uses: actions/upload-artifact@v2
# with:
# path: dist/macos/*.pkg
# name: radare2-${{ steps.r2v.outputs.branch }}_macos_m1.pkg
macos-test:
runs-on: macos-latest
if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install r2pipe
- name: Building Radare2
run: export CFLAGS="-O2"; sys/install.sh
- name: Running tests
run: pip3 install r2pipe; make tests
# Mobile
ios-cydia:
if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install pkg-config/ldid2 with Homebrew
run: brew install pkg-config ldid
# - name: Create cydia32 package
# run: ./sys/ios-cydia32.sh
# - name: List sys/cydia
# run: ls -lahR ./sys/cydia
# - uses: actions/upload-artifact@v2
# with:
# name: radare2-arm32_${{ steps.extract_version.outputs.branch }}_iphoneos-arm
# path: ./dist/cydia/radare2/radare2-arm32_${{ steps.extract_version.outputs.branch }}_iphoneos-arm.deb
- name: Create cydia package
run: ./sys/ios-cydia.sh
- name: Create iOS SDK
run: |
./sys/ios-sdk.sh
pushd /tmp/r2ios
zip -r /tmp/r2ios-sdk.zip *
popd
mv /tmp/r2ios-sdk.zip .
- name: Extract r2 version
run: echo "##[set-output name=branch;]$( python sys/version.py )"
id: r2v
- uses: actions/upload-artifact@v2
with:
name: r2ios_sdk-${{ steps.r2v.outputs.branch }}.zip
path: ./r2ios-sdk.zip
- uses: actions/upload-artifact@v2
with:
name: radare2-${{ steps.r2v.outputs.branch }}_iphoneos-arm64.zip
path: ./dist/cydia/radare2*/*.deb
android-acr-aarch64:
if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt-get --assume-yes install pax wget gperf cabextract unzip python3-wheel python3-setuptools python3-pip && pip3 install --user meson ninja
- name: Compile with acr
run: |
sys/android-ndk-install.sh
sys/android-build.sh arm64
ls -l
- name: Extract r2 version
run: echo "##[set-output name=branch;]$( cd sys;python version.py )"
id: r2v
- uses: actions/upload-artifact@v2
with:
name: radare2-${{ steps.r2v.outputs.branch }}-android-aarch64.tar.gz
path: radare2*android*aarch64.tar.gz
android-meson:
if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# name: [x86_64, arm, aarch64]
name: [x86_64, arm]
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt-get --assume-yes install pax wget cabextract unzip python3-wheel python3-setuptools python3-pip && pip3 install --user meson ninja
- name: Compile with meson
run: |
export PATH=${HOME}/.local/bin:${PATH}
CFLAGS="-static" LDFLAGS="-static" meson --buildtype release --default-library static --prefix=/tmp/android-dir -Dblob=true build --cross-file .github/meson-android-${{ matrix.name }}.ini
ninja -C build && ninja -C build install
- name: Create radare2-android-${{ matrix.name }}.tar.gz
run: |
cd /tmp
rm -rf android-dir/include android-dir/lib
tar --transform 's/android-dir/data\/data\/org.radareorg.radare2installer/g' -cvf radare2-android-${{ matrix.name }}.tar.gz android-dir/
- name: Extract r2 version
run: echo "##[set-output name=branch;]$( cd sys;python version.py )"
id: r2v
- uses: actions/upload-artifact@v2
with:
name: radare2-${{ steps.r2v.outputs.branch }}-android-${{ matrix.name }}.tar.gz
path: /tmp/radare2-android-${{ matrix.name }}.tar.gz