55 test :
66 strategy :
77 matrix :
8- python_version : ['2.7 ', '3.10 ']
8+ python_version : ['3.10 ', '3.12 ']
99 os : [ubuntu-latest]
10+ include :
11+ - python_version : ' 2.7'
12+ os : ubuntu-22.04
1013 runs-on : ${{ matrix.os }}
1114 timeout-minutes : 30
15+ services :
16+ libcdb-cache :
17+ image : nginx
18+ volumes :
19+ - /home/runner/libcdb-cache:/var/cache/nginx
20+ ports :
21+ - 3000:3000 # https://debuginfod.elfutils.org proxy cache
22+ - 3001:3001 # https://libc.rip/ proxy cache
23+ - 3002:3002 # http://archive.ubuntu.com/ proxy cache
24+ - 3003:3003 # https://gitlab.com/ proxy cache
25+ env :
26+ DEBUGINFOD_URLS : http://localhost:3000/
27+ PWN_LIBCRIP_URL : http://localhost:3001/
28+ PWN_UBUNTU_ARCHIVE_URL : http://localhost:3002/
29+ PWN_GITLAB_LIBCDB_URL : http://localhost:3003/
1230 steps :
1331 - uses : actions/checkout@v4
1432 with :
@@ -18,26 +36,54 @@ jobs:
1836 run : |
1937 git fetch origin
2038 git log --oneline --graph -10
39+
40+ - name : Fix libcdb-cache permissions
41+ id : fix-perms
42+ run : |
43+ sudo chown -R runner:runner /home/runner/libcdb-cache
44+ echo "date=$(/bin/date -u "+%Y%m%d%H%M%S")" >> $GITHUB_OUTPUT
45+
46+ - name : Cache for libcdb requests
47+ uses : actions/cache@v4
48+ with :
49+ path : ~/libcdb-cache
50+ key : libcdb-python${{ matrix.python_version }}-${{ steps.fix-perms.outputs.date }}
51+ restore-keys : |
52+ libcdb-python${{ matrix.python_version }}-
53+ libcdb-
54+
55+ - name : Install libcdb-cache service config
56+ run : |
57+ sudo chown -R 101:101 /home/runner/libcdb-cache
58+ container_id=$(docker ps --all --filter volume=/home/runner/libcdb-cache --no-trunc --format "{{.ID}}")
59+ docker cp ./travis/libcdb_nginx_cache.conf $container_id:/etc/nginx/nginx.conf
60+ docker restart $container_id
2161
2262 - name : Install RPyC for gdb
2363 run : |
24- # The version packaged in python3-rpyc is too old on Ubuntu 22.04
64+ # The version packaged in python3-rpyc is too old on Ubuntu 24.04
65+ # We use ^6.0 from pip.
2566 sudo apt-get update && sudo apt-get install -y python3-pip gdb gdbserver
26- /usr/bin/python -m pip install rpyc
67+ /usr/bin/python -m pip install --break-system-packages rpyc || /usr/bin/python -m pip install rpyc
2768 gdb --batch --quiet --nx --nh --ex 'py import rpyc; print(rpyc.version.version)'
28-
69+
2970 - name : Cache for pip
3071 uses : actions/cache@v4
31- id : cache-pip
72+ if : matrix.python_version == '2.7'
3273 with :
3374 path : ~/.cache/pip
34- key : ${{ matrix.os }}-cache-pip
75+ key : ${{ matrix.os }}-${{ matrix.python_version }}-cache-pip-${{ hashFiles('**/pyproject.toml', '**/requirements*.txt') }}
76+ restore-keys : ${{ matrix.os }}-${{ matrix.python_version }}-cache-pip-
3577
3678 - name : Set up Python ${{ matrix.python_version }}
3779 if : matrix.python_version != '2.7'
3880 uses : actions/setup-python@v5
3981 with :
4082 python-version : ${{ matrix.python_version }}
83+ cache : ' pip'
84+ cache-dependency-path : |
85+ **/pyproject.toml
86+ **/requirements*.txt
4187
4288 - name : Set up Python 2.7
4389 if : matrix.python_version == '2.7'
78124 binutils-powerpc-linux-gnu \
79125 binutils-s390x-linux-gnu \
80126 binutils-sparc64-linux-gnu \
127+ binutils-riscv64-linux-gnu \
81128 gcc-multilib \
82129 libc6-dbg \
83130 elfutils \
@@ -149,11 +196,18 @@ jobs:
149196 pwn shellcraft --list |tail
150197 pwn shellcraft -l --syscalls |tail
151198 pwn shellcraft -l execve
199+ pwn shellcraft -l execve + exit
152200 pwn shellcraft --show i386.linux.loader_append
201+ pwn shellcraft --show i386.linux.loader_append + i386.linux.sh
153202 pwn shellcraft -f asm --color amd64.linux.sh
203+ pwn shellcraft -f asm --color amd64.linux.setreuid + amd64.linux.cat /etc/passwd
204+ pwn shellcraft -f asm --color amd64.linux.setreuid = amd64.linux.cat /key+secret --delim =
154205 pwn shellcraft -f elf amd64.linux.syscalls.exit 0 </dev/null |pwn hex
206+ pwn shellcraft -f elf amd64.linux.cat /etc/passwd + amd64.linux.syscalls.exit 0 </dev/null |pwn hex
155207 pwn shellcraft -f i --color amd64.linux.cat /etc/passwd </dev/null
208+ pwn shellcraft -f i --color amd64.linux.cat /etc/passwd + amd64.linux.sh </dev/null
156209 pwn shellcraft -f c amd64.linux.syscalls.exit 0 </dev/null
210+ pwn shellcraft -f c amd64.linux.cat /etc/passwd + amd64.linux.syscalls.exit 0 </dev/null
157211 pwn shellcraft -f str aarch64.linux.sh </dev/null
158212 pwn shellcraft -abr -f elf -o /dev/null amd64.linux.cat /etc/passwd </dev/null
159213 pwn shellcraft -nzr thumb.linux.syscalls.execve /bin/cat '["/bin/cat", "/etc/os-release"]' </dev/null
@@ -195,16 +249,45 @@ jobs:
195249 python -m build
196250
197251 - uses : actions/upload-artifact@v4
198- if : matrix.python_version != '2.7 '
252+ if : matrix.python_version == '3.10 '
199253 with :
200254 name : packages
201255 path : dist/
256+ include-hidden-files : true
202257
203258 - uses : actions/upload-artifact@v4
204259 with :
205260 name : coverage-${{ matrix.python_version }}
206261 path : .coverage*
262+ include-hidden-files : true
263+
264+ - name : Fix libcdb-cache permissions
265+ run : |
266+ container_id=$(docker ps --filter volume=/home/runner/libcdb-cache --no-trunc --format "{{.ID}}")
267+ docker stop $container_id
268+ sudo chown -R runner:runner /home/runner/libcdb-cache
207269
270+ windows-test :
271+ runs-on : windows-latest
272+ timeout-minutes : 30
273+ continue-on-error : true
274+ steps :
275+ - uses : actions/checkout@v4
276+
277+ - name : Set up Python 3.12
278+ uses : actions/setup-python@v5
279+ with :
280+ python-version : ' 3.12'
281+
282+ - name : Install dependencies
283+ run : |
284+ pip install --upgrade pip
285+ pip install --upgrade --editable .
286+
287+ - name : Sanity checks
288+ run : |
289+ python -bb -c 'from pwn import *'
290+ python -bb examples/text.py
208291
209292 upload-coverage :
210293 runs-on : ubuntu-latest
@@ -221,7 +304,7 @@ jobs:
221304
222305 - name : Install coveralls
223306 run : |
224- pip install tomli coveralls
307+ pip install --break-system-packages tomli coveralls || pip install tomli coveralls
225308
226309 - name : Upload coverage to coveralls.io
227310 run : |
0 commit comments