Test installation of dependencies with pip #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Testing usage of plasmasm with various compilers | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
gcc: | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [x86, x64] | |
os: [ubuntu-20.04, ubuntu-22.04] | |
gcc-version: [4.4, 4.6, 4.8, 5, 6, 7, 8, 9, 10, 11, 12, 13] | |
backend: [AMOCO, MIASM] | |
exclude: | |
- {os: ubuntu-22.04, gcc-version: 4.4} | |
- {os: ubuntu-22.04, gcc-version: 4.6} | |
- {os: ubuntu-22.04, gcc-version: 4.8, platform: x86} | |
- {os: ubuntu-20.04, gcc-version: 4.8} | |
- {os: ubuntu-20.04, gcc-version: 5} | |
- {os: ubuntu-22.04, gcc-version: 5, platform: x86} | |
- {os: ubuntu-20.04, gcc-version: 6} | |
- {os: ubuntu-22.04, gcc-version: 6, platform: x86} | |
- {os: ubuntu-20.04, gcc-version: 7} | |
- {os: ubuntu-22.04, gcc-version: 8} | |
- {os: ubuntu-20.04, gcc-version: 9} | |
- {os: ubuntu-20.04, gcc-version: 10} | |
- {os: ubuntu-20.04, gcc-version: 11} | |
- {os: ubuntu-20.04, gcc-version: 12} | |
- {os: ubuntu-20.04, gcc-version: 13} | |
- {backend: MIASM, platform: x64} | |
runs-on: ${{ matrix.os }} | |
name: '${{ matrix.os }} / gcc ${{ matrix.gcc-version }} ${{ matrix.platform }} / ${{ matrix.backend }}' | |
env: | |
PLATFORM: ${{ matrix.platform }} | |
BACKEND: ${{ matrix.backend }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Set up GCC ${{ matrix.gcc-version }} | |
uses: LRGH/setup-gcc@v3 | |
with: | |
version: ${{ matrix.gcc-version }} | |
platform: ${{ matrix.platform }} | |
- 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 | |
echo > amoco/amoco/ui/app.py # avoid dependency on blessed | |
echo 'mmapView = lambda x:None; mapperView = mmapView' > amoco/amoco/ui/views.py # avoid dependency on blessed | |
mv elfesteem miasmX amoco crysp .. | |
export PYTHONPATH=../elfesteem:../miasmx:../amoco:../crysp | |
echo '** Simple tests to verify that dependencies are working' | |
test ${{ matrix.backend }} = MIASM && \ | |
python tools/disass.py -c /${{ matrix.backend }} non_regression/basic_x86_linux.intel.s | |
python tools/disass.py -c /${{ matrix.backend }} non_regression/basic_x86_linux.att.s | |
python tools/disass.py -c /${{ matrix.backend }} non_regression/basic_x86_linux.o | |
- name: Testing gcc | |
run: | | |
if test 'x86' = $PLATFORM; then flags=-m32; else flags=; fi | |
echo 'int main() { return 0; }' > a.c | |
gcc --version | |
gcc $flags a.c | |
file a.out | |
./a.out | |
- name: Testing compile.py with a minimal program | |
run: | | |
if test 'x86' = $PLATFORM; then flags=-m32; else flags=; fi | |
export PATH=$(pwd)/tools:$PATH | |
compile.py -parse_asm -c/${{ matrix.backend }} gcc $flags a.c | |
compile.py -parse_asm -c/${{ matrix.backend }} -rw -dead gcc $flags a.c | |
compile.py -parse_obj -c/${{ matrix.backend }} gcc $flags a.c | |
compile.py -change -c/${{ matrix.backend }} gcc $flags 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 | |
flags="-O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN" | |
if test 'x86' = $PLATFORM; then flags="-m32 $flags"; fi | |
make clean; make test CFLAGS="$flags" SFLAGS="-fPIC $flags -DPIC" CC='gcc' | |
make clean; make test CFLAGS="$flags" SFLAGS="-fPIC $flags -DPIC" CC='compile.py -parse_asm -c/${{ matrix.backend }} gcc' | |
make clean; make test CFLAGS="$flags" SFLAGS="-fPIC $flags -DPIC" CC='compile.py -parse_asm -c/${{ matrix.backend }} -rw -dead gcc' | |
make clean; make test CFLAGS="$flags" SFLAGS="-fPIC $flags -DPIC" CC='compile.py -parse_obj -c/${{ matrix.backend }} gcc' | |
make clean; make test CFLAGS="$flags" SFLAGS="-fPIC $flags -DPIC" CC='compile.py -change -c/${{ matrix.backend }} gcc' |