about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2021-08-23 18:03:20 +0200
committerGitHub <noreply@github.com>2021-08-23 18:03:20 +0200
commita7f9f78b67ab50050172be151b324789f96ac43d (patch)
treefdcaea21f3b97c7ed7bd4a785979058abbbe8b7e
parent6fa54ea61f193775970240a34d67a6423ee146d7 (diff)
parent02489ad58117cc9e0c70e0e3f1ce4ab0e71d5fb0 (diff)
downloadfocaccia-miasm-a7f9f78b67ab50050172be151b324789f96ac43d.tar.gz
focaccia-miasm-a7f9f78b67ab50050172be151b324789f96ac43d.zip
Merge pull request #1379 from serpilliere/github_actions
Add github actions
-rw-r--r--.github/actions/install/action.yml6
-rwxr-xr-x.github/actions/install/install.sh10
-rw-r--r--.github/workflows/tests.yml100
-rw-r--r--README.md5
4 files changed, 119 insertions, 2 deletions
diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml
new file mode 100644
index 00000000..917ce2b5
--- /dev/null
+++ b/.github/actions/install/action.yml
@@ -0,0 +1,6 @@
+
+runs:
+  using: "composite"
+  steps:
+    - run: ${{ github.action_path }}/install.sh
+      shell: bash
diff --git a/.github/actions/install/install.sh b/.github/actions/install/install.sh
new file mode 100755
index 00000000..7a84c2a2
--- /dev/null
+++ b/.github/actions/install/install.sh
@@ -0,0 +1,10 @@
+#! /bin/bash
+
+
+# codespell
+pip install codespell
+# install
+python setup.py build build_ext
+python setup.py install
+# extended tests
+git clone https://github.com/cea-sec/miasm-extended-tests
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
new file mode 100644
index 00000000..327b2426
--- /dev/null
+++ b/.github/workflows/tests.yml
@@ -0,0 +1,100 @@
+name: Miasm regression tests
+
+on: [push, pull_request]
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: ['2.7', '3.6']
+
+    steps:
+
+    - name: Git checkout
+      uses: actions/checkout@v2
+
+    - name: Use Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v2
+      with:
+        python-version: ${{ matrix.python-version }}
+
+    - name: Install requirements
+      run: pip install -r requirements.txt
+
+    - name: Install optional requirements
+      run: pip install -r optional_requirements.txt
+
+    - name: Install llvm
+      run: sudo apt-get install llvm
+
+    - name: Install Miasm
+      uses: ./.github/actions/install
+
+    - name: Base tests
+      run: cd test; python --version |& grep -q "Python 3" || flags="-W error"; python $flags test_all.py && git ls-files -o --exclude-standard
+
+    - name: Regression tests
+      run: cd test; python --version |& grep -q "Python 3" || flags="-W error"; python $flags test_all.py $MIASM_TEST_EXTRA_ARG && git ls-files -o --exclude-standard
+      env:
+        MIASM_TEST_EXTRA_ARG: -o regression -t long,python,llvm,gcc,z3,qemu,cparser
+
+    - name: Run examples
+      run: cd test; python --version |& grep -q "Python 3" || flags="-W error"; python $flags test_all.py $MIASM_TEST_EXTRA_ARG && git ls-files -o --exclude-standard
+      env:
+        MIASM_TEST_EXTRA_ARG: -o example -t long,python,llvm,gcc,z3,qemu,cparser
+
+    - name: Test long tests
+      run: cd test; python --version |& grep -q "Python 3" || flags="-W error"; python $flags test_all.py $MIASM_TEST_EXTRA_ARG && git ls-files -o --exclude-standard
+      env:
+        MIASM_TEST_EXTRA_ARG: -o long
+
+    - name: Test qemu jitter llvm/gcc
+      run: cd test; python --version |& grep -q "Python 3" || flags="-W error"; python $flags test_all.py $MIASM_TEST_EXTRA_ARG && git ls-files -o --exclude-standard
+      env:
+        MIASM_TEST_EXTRA_ARG: -o qemu -t llvm,gcc
+
+    - name: Test qemu jitter python/gcc
+      run: cd test; python --version |& grep -q "Python 3" || flags="-W error"; python $flags test_all.py $MIASM_TEST_EXTRA_ARG && git ls-files -o --exclude-standard
+      env:
+        MIASM_TEST_EXTRA_ARG: -o qemu -t python,gcc
+
+    - name: Test qemu jitter python/llvm
+      run: cd test; python --version |& grep -q "Python 3" || flags="-W error"; python $flags test_all.py $MIASM_TEST_EXTRA_ARG && git ls-files -o --exclude-standard
+      env:
+        MIASM_TEST_EXTRA_ARG: -o qemu -t python,llvm
+
+    - name: Test llvm qemu/long
+      run: cd test; python --version |& grep -q "Python 3" || flags="-W error"; python $flags test_all.py $MIASM_TEST_EXTRA_ARG && git ls-files -o --exclude-standard
+      env:
+        MIASM_TEST_EXTRA_ARG: -o llvm -t qemu,long
+
+    - name: Test gcc qemu/long
+      run: cd test; python --version |& grep -q "Python 3" || flags="-W error"; python $flags test_all.py $MIASM_TEST_EXTRA_ARG && git ls-files -o --exclude-standard
+      env:
+        MIASM_TEST_EXTRA_ARG: -o gcc -t qemu,long
+
+    - name: Test python qemu/long
+      run: cd test; python --version |& grep -q "Python 3" || flags="-W error"; python $flags test_all.py $MIASM_TEST_EXTRA_ARG && git ls-files -o --exclude-standard
+      env:
+        MIASM_TEST_EXTRA_ARG: -o python -t qemu,long
+
+    - name: Z3 tests
+      run: cd test; python --version |& grep -q "Python 3" || flags="-W error"; python $flags test_all.py $MIASM_TEST_EXTRA_ARG && git ls-files -o --exclude-standard
+      env:
+        MIASM_TEST_EXTRA_ARG: -o z3
+
+    - name: Cparser tests
+      run: cd test; python --version |& grep -q "Python 3" || flags="-W error"; python $flags test_all.py $MIASM_TEST_EXTRA_ARG && git ls-files -o --exclude-standard
+      env:
+        MIASM_TEST_EXTRA_ARG: -o cparser
+
+    - name: Loader tests
+      run: cd "miasm-extended-tests/$MIASM_EXTENTED_TESTS_LOADER" && ./test_dll.py
+      env:
+        MIASM_EXTENTED_TESTS_LOADER: loader
+
+    - name: IR tests
+      run: cd "miasm-extended-tests/$MIASM_EXTENTED_TESTS_IR" && ./run.sh
+      env:
+        MIASM_EXTENTED_TESTS_IR: ir_tests
diff --git a/README.md b/README.md
index f322a790..07e1d8e6 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,8 @@
 [![Build Status](https://travis-ci.org/cea-sec/miasm.svg)](https://travis-ci.org/cea-sec/miasm)
 [![Build status](https://ci.appveyor.com/api/projects/status/g845jr23nt18uf29/branch/master?svg=true)](https://ci.appveyor.com/project/cea-sec/miasm)
-[![Code Climate](https://codeclimate.com/github/cea-sec/miasm/badges/gpa.svg)](https://codeclimate.com/github/cea-sec/miasm) [![Join the chat at https://gitter.im/cea-sec/miasm](https://badges.gitter.im/cea-sec/miasm.svg)](https://gitter.im/cea-sec/miasm?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-
+[![Miasm tests](https://github.com/cea-sec/miasm/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/cea-sec/miasm/actions/workflows/tests.yml?branch=master)
+[![Code Climate](https://codeclimate.com/github/cea-sec/miasm/badges/gpa.svg)](https://codeclimate.com/github/cea-sec/miasm)
+[![Join the chat at https://gitter.im/cea-sec/miasm](https://badges.gitter.im/cea-sec/miasm.svg)](https://gitter.im/cea-sec/miasm?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
 
 <p align="center">
 <img src="https://raw.githubusercontent.com/cea-sec/miasm/master/doc/logo_miasm.png">