-
Notifications
You must be signed in to change notification settings - Fork 103
130 lines (109 loc) · 4.36 KB
/
continuous_integration.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
name: CI
on:
push:
branches:
- 'main'
- 'dev**'
pull_request:
branches:
- 'main'
- 'dev**'
jobs:
build:
if: github.repository == 'avatartwo/avatar2'
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9"]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y -m -f --install-suggests cmake build-essential git libcapstone3 libcapstone-dev
python -m pip install --upgrade pip
pip install pytest
pip install "cffi>1.14.3" # for pypanda
- name: Check out repository code
uses: actions/checkout@v2
- name: Build avatar2
run: |
cd ${{ github.workspace }}
python setup.py install
- name: Install debuggers targets
run: |
sudo apt-get install -y -m -f --install-suggests gdb gdb-multiarch openocd
- name: Build avatar-qemu target
run: |
cd ${{ github.workspace }}/targets
echo yes | ./build_qemu.sh arm-softmmu,mips-softmmu
cd src/avatar-qemu/build
sudo make install
- name: Run unit tests
env:
AVATAR2_ARCH: ARM
AVATAR2_GDB_EXECUTABLE: gdb-multiarch
run: |
cd ${{ github.workspace }}
python ./tests/hello_world.py
python ./tests/gdb_memory_map_loader.py
- name: Run unit tests for ARM
env:
AVATAR2_ARCH: ARM
AVATAR2_GDB_EXECUTABLE: gdb-multiarch
AVATAR2_QEMU_EXECUTABLE: qemu-system-arm
run: |
cd ${{ github.workspace }}/tests
pytest test_gdbplugin.py \
test_gdbprotocol.py \
test_inceptionprotocol.py \
test_remote_memoryprotocol.py \
test_qemutarget.py
- name: Run unit tests for MIPS
env:
AVATAR2_ARCH: MIPS
AVATAR2_GDB_EXECUTABLE: gdb-multiarch
AVATAR2_QEMU_EXECUTABLE: qemu-system-mips
run: |
cd ${{ github.workspace }}/tests
pytest test_gdbplugin.py \
test_gdbprotocol.py \
test_inceptionprotocol.py \
test_remote_memoryprotocol.py \
test_qemutarget.py
- name: Build panda target
run: |
git clone https://github.com/panda-re/panda.git
cd panda
git checkout 5fb8a5098d0647a13e5e7d39d20ff9f04242572d
sudo prefix=/usr/local ./panda/scripts/install_ubuntu.sh i386-softmmu,arm-softmmu,mips-softmmu
pushd build
sudo make install
# Install pandare in the matrix python environment
sudo chown -R $(id -u):$(id -u) ../panda/python/core
pip install ../panda/python/core
- name: Run unit tests on panda target for ARM
env:
AVATAR2_ARCH: ARM
AVATAR2_GDB_EXECUTABLE: gdb-multiarch
AVATAR2_QEMU_EXECUTABLE: panda-system-arm
AVATAR2_PANDA_EXECUTABLE: panda-system-arm
run: |
cd ${{ github.workspace }}/tests
pytest test_qemutarget.py \
test_pypandatarget.py
- name: Run unit tests on panda target for MIPS
env:
AVATAR2_ARCH: MIPS
AVATAR2_GDB_EXECUTABLE: gdb-multiarch
AVATAR2_QEMU_EXECUTABLE: panda-system-mips
AVATAR2_PANDA_EXECUTABLE: panda-system-mips
run: |
cd ${{ github.workspace }}/tests
pytest test_qemutarget.py \
test_pypandatarget.py