forked from pwndbg/pwndbg
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (98 loc) · 2.55 KB
/
tests.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
name: Unit tests
on:
push:
branches:
- dev
paths:
- '**'
- '!mkdocs.yml'
- '!docs/**'
- '!*.md'
pull_request:
paths:
- '**'
- '!mkdocs.yml'
- '!docs/**'
- '!*.md'
jobs:
tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Cache for pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ matrix.os }}-cache-pip
- name: Install dependencies
run: |
./setup.sh
./setup-dev.sh
- name: Python version info
run: |
echo 'GDB py:'
gdb --batch --quiet --nx --nh --ex 'py import sys; print(sys.version)'
echo 'Installed py:'
./.venv/bin/python -V
echo 'Installed packages:'
./.venv/bin/python -m pip freeze
# We set `kernel.yama.ptrace_scope=0` for `attachp` command tests
- name: Run tests
run: |
source .venv/bin/activate
mkdir .cov
sudo sysctl -w kernel.yama.ptrace_scope=0
./tests.sh --cov
- name: Process coverage data
if: matrix.os == 'ubuntu-22.04'
run: |
./.venv/bin/coverage combine
./.venv/bin/coverage xml
- name: "Upload coverage to Codecov"
if: matrix.os == 'ubuntu-22.04'
uses: codecov/codecov-action@v3
qemu-tests:
runs-on: [ubuntu-22.04]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Cache for pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ matrix.os }}-cache-pip
- name: Install dependencies
run: |
./setup.sh
./setup-dev.sh
mkdir .cov
- name: Set up cache for QEMU images
id: qemu-cache
uses: actions/cache@v3
with:
path: ./tests/qemu-tests/images
key: ${{ matrix.os }}-cache-qemu-images
- name: Download images
run: |
./tests/qemu-tests/download_images.sh
# We set `kernel.yama.ptrace_scope=0` for `gdb-pt-dump`
- name: Run tests
working-directory: ./tests/qemu-tests
run: |
sudo sysctl -w kernel.yama.ptrace_scope=0
./tests.sh --cov
- name: Run qemu-user tests
working-directory: ./tests/qemu-tests
run: |
./test_qemu.sh
- name: Process coverage data
run: |
./.venv/bin/coverage combine
./.venv/bin/coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3