-
Notifications
You must be signed in to change notification settings - Fork 0
193 lines (189 loc) · 8.17 KB
/
python-package.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
name: Non-regression testing
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
non-regression-for-python:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04"] # , "ubuntu-lastest", "macos-latest"]
python-version: ["3.10", "pypy2.7", "pypy3.9"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install pytest pyparsing coverage codecov
git clone https://github.com/LRGH/elfesteem
git clone https://github.com/LRGH/miasmX
git clone https://github.com/LRGH/crysp
git clone https://github.com/LRGH/amoco
echo > amoco/amoco/__init__.py # don't import grandalf
cat plasmasm/python/amoco-config.py > amoco/amoco/config.py # avoid dependency on traitlets
mv elfesteem miasmX amoco crysp ..
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
echo '** Simple tests to verify that dependencies are working'
python tools/disass.py -c /MIASM non_regression/basic_x86_linux.intel.s
python tools/disass.py -c /MIASM non_regression/basic_x86_linux.att.s
python tools/disass.py -c /MIASM non_regression/basic_x86_linux.o
python tools/disass.py -c /AMOCO non_regression/basic_x86_linux.att.s
python tools/disass.py -c /AMOCO non_regression/basic_x86_linux.o
- name: Unit tests asm_basic (without using pytest module)
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
python non_regression/run_tests.py test_asm_basic
- name: Unit tests asm_basic
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
coverage run -m pytest --durations=10 non_regression/test_asm_basic.py
- name: Unit tests asm_other
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
coverage run -m pytest --durations=10 non_regression/test_asm_other.py
- name: Unit tests asm_switch
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
coverage run -m pytest --durations=10 non_regression/test_asm_switch.py
- name: Unit tests bin
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
coverage run -m pytest --durations=10 non_regression/test_bin.py
- name: Unit tests display
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
coverage run -m pytest --durations=10 non_regression/test_display.py
- name: Unit tests objdump
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
coverage run -m pytest --durations=10 non_regression/test_objdump.py
- name: Global tests asm_fullsoftware
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
coverage run -m pytest --durations=10 non_regression/test_asm_fullsoftware.py
- name: Update codecov
run: |
codecov
python23:
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up Python 2.3
run: |
cd ..
curl -O https://www.python.org/ftp/python/2.3.7/Python-2.3.7.tgz
tar xzf Python-2.3.7.tgz
cd Python-2.3.7
# We need to disable FORTIFY_SOURCE to compile python 2.3
# cf. https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/286334
./configure BASECFLAGS=-U_FORTIFY_SOURCE
make
export PATH=$(pwd):$PATH
cd ../plasmasm
python -c 'import sys;print(sys.version)'
- name: Install dependencies
run: |
git clone https://github.com/LRGH/elfesteem
git clone https://github.com/LRGH/miasmX
git clone https://github.com/LRGH/crysp
git clone https://github.com/LRGH/amoco
echo > amoco/amoco/__init__.py # don't import grandalf
cat plasmasm/python/amoco-config.py > amoco/amoco/config.py # avoid dependency on traitlets
mv elfesteem miasmX amoco crysp ..
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
echo '** Simple tests to verify that dependencies are working'
# NB: amoco is not compatible with python2.3
python tools/disass.py -c /MIASM non_regression/basic_x86_linux.intel.s
python tools/disass.py -c /MIASM non_regression/basic_x86_linux.att.s
python tools/disass.py -c /MIASM non_regression/basic_x86_linux.o
- name: Unit tests asm_basic (pytest is not compatible with python2.3)
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
python non_regression/run_tests.py test_asm_basic
- name: Unit tests asm_other
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
python non_regression/run_tests.py test_asm_other
- name: Unit tests asm_switch
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
python non_regression/run_tests.py test_asm_switch
- name: Unit tests bin
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
python non_regression/run_tests.py test_bin
- name: Unit tests display
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
python non_regression/run_tests.py test_display
- name: Unit tests objdump
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
python non_regression/run_tests.py test_objdump
- name: Global tests asm_fullsoftware
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
python non_regression/run_tests.py test_asm_fullsoftware
matrix-with-compilers:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04"]
gcc-version: ["7"] # , "8", "9", "10", "11"]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up GCC ${{ matrix.gcc-version }}
uses: egor-tensin/setup-gcc@v1
with:
version: ${{ matrix.gcc-version }}
platform: x64
- name: Install dependencies
run: |
python -m pip install pytest pyparsing coverage codecov
git clone https://github.com/LRGH/elfesteem
git clone https://github.com/LRGH/miasmX
git clone https://github.com/LRGH/crysp
git clone https://github.com/LRGH/amoco
echo > amoco/amoco/__init__.py # don't import grandalf
cat plasmasm/python/amoco-config.py > amoco/amoco/config.py # avoid dependency on traitlets
mv elfesteem miasmX amoco crysp ..
export PYTHONPATH=../elfesteem:../miasmx:../amoco:../crysp
echo '** Simple tests to verify that dependencies are working'
python tools/disass.py -c /MIASM non_regression/basic_x86_linux.intel.s || true
python tools/disass.py -c /MIASM non_regression/basic_x86_linux.att.s || true
python tools/disass.py -c /MIASM non_regression/basic_x86_linux.o || true
python tools/disass.py -c /AMOCO non_regression/basic_x86_linux.att.s || true
python tools/disass.py -c /AMOCO non_regression/basic_x86_linux.o || true
- name: Testing compile.py with a minimal program
run: |
export PATH=$(pwd)/tools:$PATH
echo 'int main() { return 10; }' > a.c
compile.py -parse_asm gcc a.c
compile.py -parse_asm -rw -dead gcc a.c
compile.py -parse_obj gcc a.c
compile.py -change gcc a.c
- name: Testing compile.py with zlib
run: |
export PATH=$(pwd)/tools:$PATH
curl -O https://zlib.net/fossils/zlib-1.2.8.tar.gz
tar xzf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make clean; make test CC='compile.py -parse_asm gcc'
make clean; make test CC='compile.py -parse_asm -rw -dead gcc'
make clean; make test CC='compile.py -parse_obj gcc'
make clean; make test CC='compile.py -change gcc'