Skip to content

Test installation of dependencies with pip #17

Test installation of dependencies with pip

Test installation of dependencies with pip #17

Workflow file for this run

name: Testing portability (OS and python version)
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04", "ubuntu-latest", "macos-latest"]
python-version: ["3.10", "pypy2.7", "pypy3.9", "graalpy-22.3"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
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
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 ..
- name: Test MIASM dependency
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
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: Test AMOCO dependency
if: ${{ ! startsWith(matrix.python-version, 'graalpy') }}
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
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: Coverage does not work with graalpy
if: ${{ startsWith(matrix.python-version, 'graalpy') }}
run: |
echo '#! /bin/sh' > `which coverage`
echo 'shift; shift; python "$@"' >> `which coverage`
echo '#! /bin/sh' > `which codecov`
- 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 errors
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
coverage run -a -m pytest --durations=10 non_regression/test_errors.py
- name: Unit tests asm_basic
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
coverage run -a -m pytest --durations=10 non_regression/test_asm_basic.py
- name: Unit tests asm_macosx
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
coverage run -a -m pytest --durations=10 non_regression/test_asm_macosx.py
- name: Unit tests asm_switch
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
coverage run -a -m pytest --durations=10 non_regression/test_asm_switch.py
- name: Unit tests asm_other
# pypy on macosx is really too slow
if: ${{ ! startsWith(matrix.python-version, 'pypy') || ! startsWith(matrix.os, 'macos') }}
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
coverage run -a -m pytest --durations=10 non_regression/test_asm_other.py
- name: Unit tests bin
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
coverage run -a -m pytest --durations=10 non_regression/test_bin.py
- name: Unit tests display
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
coverage run -a -m pytest --durations=10 non_regression/test_display.py
- name: Unit tests lineapi
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
coverage run -a -m pytest --durations=10 non_regression/test_lineapi.py
- name: Unit tests objdump
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
coverage run -a -m pytest --durations=10 non_regression/test_objdump.py
- name: Global tests asm_fullsoftware
# pypy on macosx is really too slow
if: ${{ ! startsWith(matrix.python-version, 'pypy') || ! startsWith(matrix.os, 'macos') }}
run: |
export PYTHONPATH=../elfesteem:../miasmX:../amoco:../crysp
coverage run -a -m pytest --durations=10 non_regression/test_asm_fullsoftware.py
- name: Update codecov
run: |
codecov
pip-install:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04", "ubuntu-latest", "macos-latest"]
python-version: ["3.10", "pypy2.7", "pypy3.9", "graalpy-22.3"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies using pip
run: |
python -m pip install pytest pyparsing coverage codecov
python -m pip install git+https://github.com/LRGH/elfesteem
python -m pip install git+https://github.com/LRGH/miasmX
python -m pip install git+https://github.com/LRGH/amoco
- name: Test MIASM dependency
run: |
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: Test AMOCO dependency
if: ${{ matrix.python-version != 'graalpy-22.3' && matrix.python-version != 'pypy2.7' }}
run: |
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: |
python non_regression/run_tests.py test_asm_basic
python23:
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- 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
sudo ln -fs $(pwd)/python /usr/local/bin/python
- name: Test python version
run: |
python -c 'import sys;print(sys.version)'
python -V
- name: Install dependencies
run: |
git clone https://github.com/LRGH/elfesteem
git clone https://github.com/LRGH/miasmX
mv elfesteem miasmX ..
export PYTHONPATH=../elfesteem:../miasmX
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 errors (pytest is not compatible with python2.3)
run: |
export PYTHONPATH=../elfesteem:../miasmX
true # python non_regression/run_tests.py test_errors
- name: Unit tests asm_basic
run: |
export PYTHONPATH=../elfesteem:../miasmX
python non_regression/run_tests.py test_asm_basic
- name: Unit tests asm_macosx
run: |
export PYTHONPATH=../elfesteem:../miasmX
python non_regression/run_tests.py test_asm_macosx
- name: Unit tests asm_switch
run: |
export PYTHONPATH=../elfesteem:../miasmX
python non_regression/run_tests.py test_asm_switch
- name: Unit tests asm_other
run: |
export PYTHONPATH=../elfesteem:../miasmX
python non_regression/run_tests.py test_asm_other
- name: Unit tests bin
run: |
export PYTHONPATH=../elfesteem:../miasmX
python non_regression/run_tests.py test_bin
- name: Unit tests display
run: |
export PYTHONPATH=../elfesteem:../miasmX
python non_regression/run_tests.py test_display
- name: Unit tests lineapi
run: |
export PYTHONPATH=../elfesteem:../miasmX
true # python non_regression/run_tests.py test_lineapi
- name: Unit tests objdump
run: |
export PYTHONPATH=../elfesteem:../miasmX
python non_regression/run_tests.py test_objdump
- name: Global tests asm_fullsoftware
run: |
export PYTHONPATH=../elfesteem:../miasmX
python non_regression/run_tests.py test_asm_fullsoftware