5
5
test :
6
6
strategy :
7
7
matrix :
8
- python_version : ['3.10', '3.12']
8
+ python_version : ['3.10', '3.12', '3.13' ]
9
9
os : [ubuntu-latest]
10
- include :
11
- - python_version : ' 2.7'
12
- os : ubuntu-22.04
13
10
runs-on : ${{ matrix.os }}
14
11
timeout-minutes : 30
12
+ services :
13
+ libcdb-cache :
14
+ image : nginx
15
+ volumes :
16
+ - /home/runner/libcdb-cache:/var/cache/nginx
17
+ ports :
18
+ - 3000:3000 # https://debuginfod.elfutils.org proxy cache
19
+ - 3001:3001 # https://libc.rip/ proxy cache
20
+ - 3002:3002 # http://archive.ubuntu.com/ proxy cache
21
+ - 3003:3003 # https://gitlab.com/ proxy cache
22
+ env :
23
+ DEBUGINFOD_URLS : http://localhost:3000/
24
+ PWN_LIBCRIP_URL : http://localhost:3001/
25
+ PWN_UBUNTU_ARCHIVE_URL : http://localhost:3002/
26
+ PWN_GITLAB_LIBCDB_URL : http://localhost:3003/
15
27
steps :
16
28
- uses : actions/checkout@v4
17
29
with :
22
34
git fetch origin
23
35
git log --oneline --graph -10
24
36
37
+ - name : Fix libcdb-cache permissions
38
+ id : fix-perms
39
+ run : |
40
+ sudo chown -R runner:runner /home/runner/libcdb-cache
41
+ echo "date=$(/bin/date -u "+%Y%m%d%H%M%S")" >> $GITHUB_OUTPUT
42
+
43
+ - name : Cache for libcdb requests
44
+ uses : actions/cache@v4
45
+ with :
46
+ path : ~/libcdb-cache
47
+ key : libcdb-python${{ matrix.python_version }}-${{ steps.fix-perms.outputs.date }}
48
+ restore-keys : |
49
+ libcdb-python${{ matrix.python_version }}-
50
+ libcdb-
51
+
52
+ - name : Install libcdb-cache service config
53
+ run : |
54
+ sudo chown -R 101:101 /home/runner/libcdb-cache
55
+ container_id=$(docker ps --all --filter volume=/home/runner/libcdb-cache --no-trunc --format "{{.ID}}")
56
+ docker cp ./travis/libcdb_nginx_cache.conf $container_id:/etc/nginx/nginx.conf
57
+ docker restart $container_id
58
+
25
59
- name : Install RPyC for gdb
26
60
run : |
27
61
# The version packaged in python3-rpyc is too old on Ubuntu 24.04
30
64
/usr/bin/python -m pip install --break-system-packages rpyc || /usr/bin/python -m pip install rpyc
31
65
gdb --batch --quiet --nx --nh --ex 'py import rpyc; print(rpyc.version.version)'
32
66
33
- - name : Cache for pip
34
- uses : actions/cache@v4
35
- if : matrix.python_version == '2.7'
36
- id : cache-pip
37
- with :
38
- path : ~/.cache/pip
39
- key : ${{ matrix.os }}-${{ matrix.python_version }}-cache-pip-${{ hashFiles('**/pyproject.toml', '**/requirements*.txt') }}
40
- restore-keys : ${{ matrix.os }}-${{ matrix.python_version }}-cache-pip-
41
-
42
67
- name : Set up Python ${{ matrix.python_version }}
43
- if : matrix.python_version != '2.7'
44
68
uses : actions/setup-python@v5
45
69
with :
46
70
python-version : ${{ matrix.python_version }}
49
73
**/pyproject.toml
50
74
**/requirements*.txt
51
75
52
- - name : Set up Python 2.7
53
- if : matrix.python_version == '2.7'
54
- run : |
55
- sudo apt-get update
56
- sudo apt-get install -y \
57
- python2.7 python2.7-dev python2-pip-whl
58
- sudo ln -sf python2.7 /usr/bin/python
59
- export PYTHONPATH=`echo /usr/share/python-wheels/pip-*py2*.whl`
60
- sudo --preserve-env=PYTHONPATH python -m pip install --upgrade pip setuptools wheel
61
- sudo chown -R $USER /usr/local/lib/python2.7
62
-
63
76
64
77
- name : Verify tag against version
65
78
if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
@@ -89,11 +102,12 @@ jobs:
89
102
binutils-s390x-linux-gnu \
90
103
binutils-sparc64-linux-gnu \
91
104
binutils-riscv64-linux-gnu \
105
+ binutils-loongarch64-linux-gnu \
92
106
gcc-multilib \
93
107
libc6-dbg \
94
108
elfutils \
95
109
patchelf
96
-
110
+
97
111
- name : Testing Corefiles
98
112
run : |
99
113
ulimit -a
@@ -119,10 +133,6 @@ jobs:
119
133
- name : Install documentation dependencies
120
134
run : pip install -r docs/requirements.txt
121
135
122
- - name : Manually install non-broken Unicorn
123
- if : matrix.python_version == '2.7'
124
- run : pip install unicorn==2.0.0rc7
125
-
126
136
- name : Disable yama ptrace_scope
127
137
run : |
128
138
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope # required by some gdb doctests
@@ -208,7 +218,6 @@ jobs:
208
218
pwn libcdb hash b229d1da1e161f95e839cf90cded5f719e5de308
209
219
210
220
- name : Build source and wheel distributions
211
- if : matrix.python_version != '2.7'
212
221
run : |
213
222
python -m build
214
223
@@ -225,6 +234,116 @@ jobs:
225
234
path : .coverage*
226
235
include-hidden-files : true
227
236
237
+ - name : Fix libcdb-cache permissions
238
+ run : |
239
+ container_id=$(docker ps --filter volume=/home/runner/libcdb-cache --no-trunc --format "{{.ID}}")
240
+ docker stop $container_id
241
+ sudo chown -R runner:runner /home/runner/libcdb-cache
242
+
243
+ android-test :
244
+ runs-on : ubuntu-latest
245
+ timeout-minutes : 30
246
+ continue-on-error : true
247
+ steps :
248
+ - uses : actions/checkout@v4
249
+
250
+ - name : Set up Python 3.12
251
+ uses : actions/setup-python@v5
252
+ with :
253
+ python-version : ' 3.12'
254
+ cache : ' pip'
255
+ cache-dependency-path : |
256
+ **/pyproject.toml
257
+ **/requirements*.txt
258
+
259
+ - name : Install Linux dependencies
260
+ run : |
261
+ sudo apt-get update
262
+ sudo apt-get install -y --no-install-recommends -o Acquire::Retries=3 \
263
+ gdb gdbserver socat \
264
+ qemu-user-static \
265
+ binutils-aarch64-linux-gnu \
266
+ binutils-arm-linux-gnueabihf \
267
+ libc6-dbg
268
+
269
+ - name : Cache for avd
270
+ uses : actions/cache@v4
271
+ id : cache-avd
272
+ with :
273
+ path : |
274
+ ~/.android
275
+ /usr/local/lib/android/sdk/emulator
276
+ /usr/local/lib/android/sdk/platform-tools
277
+ /usr/local/lib/android/sdk/system-images
278
+ key : ${{ matrix.os }}-cache-avd-${{ hashFiles('travis/setup_avd*.sh') }}
279
+ restore-keys : |
280
+ ${{ matrix.os }}-cache-avd-
281
+
282
+ - name : Install Android AVD
283
+ run : |
284
+ sudo usermod -aG kvm $USER
285
+ source travis/setup_avd_fast.sh
286
+ sed -i 's/skip_android = True/skip_android = False/' docs/source/conf.py
287
+ set | grep ^PATH >.android.env
288
+
289
+ - name : Install dependencies
290
+ run : |
291
+ pip install --upgrade pip
292
+ pip install --upgrade wheel build
293
+ pip install --upgrade flake8 appdirs
294
+ pip install --upgrade --editable .
295
+
296
+ - name : Sanity checks
297
+ run : PWNLIB_NOTERM=1 python -c 'from pwn import *; print(pwnlib.term.term_mode)'
298
+
299
+ - name : Install documentation dependencies
300
+ run : pip install -r docs/requirements.txt
301
+
302
+ - name : Coverage Doctests (Android Only)
303
+ run : |
304
+ source .android.env
305
+ PWNLIB_NOTERM=1 coverage run -m sphinx -b doctest docs/source docs/build/doctest docs/source/adb.rst
306
+
307
+ - uses : actions/upload-artifact@v4
308
+ with :
309
+ name : coverage-android
310
+ path : .coverage*
311
+ include-hidden-files : true
312
+
313
+ windows-test :
314
+ runs-on : windows-latest
315
+ timeout-minutes : 30
316
+ continue-on-error : true
317
+ steps :
318
+ - uses : actions/checkout@v4
319
+
320
+ - name : Set up Python 3.12
321
+ uses : actions/setup-python@v5
322
+ with :
323
+ python-version : ' 3.12'
324
+
325
+ - name : Install dependencies
326
+ run : |
327
+ pip install --upgrade pip
328
+ pip install --upgrade --editable .
329
+
330
+ - name : Install documentation dependencies
331
+ run : pip install -r docs/requirements.txt
332
+
333
+ - name : Sanity checks
334
+ run : |
335
+ python -bb -c 'from pwn import *'
336
+ python -bb examples/text.py
337
+
338
+ - name : Coverage doctests
339
+ run : |
340
+ python -bb -m coverage run -m sphinx -b doctest docs/source docs/build/doctest
341
+
342
+ - uses : actions/upload-artifact@v4
343
+ with :
344
+ name : coverage-windows
345
+ path : .coverage*
346
+ include-hidden-files : true
228
347
229
348
upload-coverage :
230
349
runs-on : ubuntu-latest
0 commit comments