name: CI

on:
  push:
    branches:
      - master
  pull_request:

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Build
      run: |
          python2 -m pip install --upgrade setuptools wheel
          python3 -m pip install --upgrade setuptools wheel
          python2 setup.py sdist bdist_wheel
          python3 setup.py sdist bdist_wheel
    - name: Install
      run: |
          python2 -m pip install dist/ROPGadget*py2*.whl
          python3 -m pip install dist/ROPGadget*py3*.whl
    - name: Run tests
      run: |
        cd test-suite-binaries
        ./test.sh
        ./test.sh python2
        cd ..
