Skip to content

Commit

Permalink
github workflow: additional coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
LRGH committed Feb 3, 2024
1 parent 39311c0 commit b9f9081
Showing 1 changed file with 130 additions and 19 deletions.
149 changes: 130 additions & 19 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,167 @@ on:
branches: [ "master" ]

jobs:
build:
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 (amoco is not compatible with python2.3)
run: |
python -m pip install pytest pyparsing coverage codecov
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'
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
python non_regression/run_tests.py test_asm_basic
- name: Unit tests asm_other
run: |
export PYTHONPATH=../elfesteem:../miasmX
python non_regression/run_tests.py test_asm_other
- name: Unit tests asm_switch
run: |
export PYTHONPATH=../elfesteem:../miasmX
python non_regression/run_tests.py test_asm_switch
- 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 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
matrix-with-compilers:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04"]
gcc-version: ["7"]
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
- 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
cd ..
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/plasmasm/python/amoco-config.py > amoco/amoco/config.py # avoid dependency on traitlets
cd plasmasm
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: Unit tests
run: |
coverage run -m pytest --durations=10 non_regression/test_asm_basic.py
coverage run -m pytest --durations=10 non_regression/test_asm_switch.py
coverage run -m pytest --durations=10 non_regression/test_bin.py
coverage run -m pytest --durations=10 non_regression/test_display.py
coverage run -m pytest --durations=10 non_regression/test_objdump.py
- name: Global tests
run: |
coverage run -m pytest --durations=10 non_regression/test_asm_fullsoftware.py
- name: Update codecov
run: |
codecov
- name: Testing compile.py with a minimal program
run: |
export PATH=$(pwd)/tools:$PATH
Expand Down

0 comments on commit b9f9081

Please sign in to comment.