Fix Capstone plugin #93
Workflow file for this run
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: CI Test for GEF-EXTRAS | |
env: | |
BRANCH: main | |
NB_CPU: 1 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-20.04 | |
- ubuntu-22.04 | |
name: "Run Unit tests on ${{ matrix.os }}" | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install python and toolchain | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y wget gdb-multiarch python3-dev python3-pip python3-wheel python3-setuptools git cmake gcc g++ pkg-config libglib2.0-dev gdbserver | |
sudo python3 -m pip install --upgrade pip | |
- name: Set runtime environment variables | |
run: | | |
echo PY_VER=`gdb -q -nx -ex "pi print('.'.join(map(str, sys.version_info[:2])))" -ex quit` >> $GITHUB_ENV | |
echo NB_CPU=`grep -c ^processor /proc/cpuinfo` >> $GITHUB_ENV | |
echo GEF_CI_ARCH=`uname --processor` >> $GITHUB_ENV | |
echo GEF_CACHE_DIR=`python3 -m pip cache dir` >> $GITHUB_ENV | |
echo GEF_PATH_DIR=${HOME}/gef >> $GITHUB_ENV | |
echo GEF_PATH="${HOME}/gef/gef.py" >> $GITHUB_ENV | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
id: cache-deps | |
env: | |
cache-name: cache-deps | |
with: | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
path: | | |
${{ env.GEF_CACHE_DIR }} | |
restore-keys: | |
${{ runner.os }}-pip-${{ env.cache-name }}- | |
${{ runner.os }}-pip- | |
${{ runner.os }}-${{ env.cache-name }}- | |
${{ runner.os }}- | |
- name: Install requirements | |
run: | | |
mkdir -p ${{ env.GEF_CACHE_DIR }} | |
python${{ env.PY_VER }} -m pip install --user --upgrade -r ./requirements.txt -r ./tests/requirements.txt | |
- name: Checkout GEF | |
run: | | |
git clone -b ${{ env.BRANCH }} https://github.com/hugsy/gef ${{ env.GEF_PATH_DIR }} | |
echo "source ${{ env.GEF_PATH }}" > ~/.gdbinit | |
gdb -q -ex 'gef missing' -ex 'gef help' -ex 'gef config' -ex start -ex continue -ex quit /bin/pwd | |
- name: Setup Tests | |
run: | | |
make -C tests/binaries -j ${{ env.NB_CPU }} | |
- name: Run Tests | |
run: | | |
python${{ env.PY_VER }} -m pytest --forked -n ${{ env.NB_CPU }} -v -m "not benchmark" tests/ | |
standalone: | |
runs-on: ubuntu-latest | |
name: "Verify GEF-Extras install from gef/scripts" | |
steps: | |
- name: Install python and toolchain | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y wget gdb-multiarch python3-dev python3-pip python3-wheel python3-setuptools git cmake gcc g++ pkg-config libglib2.0-dev gdbserver | |
sudo python3 -m pip install --upgrade pip | |
echo PY_VER=`gdb -q -nx -ex "pi print('.'.join(map(str, sys.version_info[:2])))" -ex quit` >> $GITHUB_ENV | |
echo NB_CPU=`grep -c ^processor /proc/cpuinfo` >> $GITHUB_ENV | |
echo GEF_CI_ARCH=`uname --processor` >> $GITHUB_ENV | |
echo GEF_CACHE_DIR=`python3 -m pip cache dir` >> $GITHUB_ENV | |
echo GEF_PATH_DIR=${HOME}/gef >> $GITHUB_ENV | |
echo GEF_EXTRAS_PATH=${HOME}/gef-extras >> $GITHUB_ENV | |
echo GEF_PATH="${HOME}/gef/gef.py" >> $GITHUB_ENV | |
- name: Checkout GEF & GEF-Extras | |
run: | | |
mkdir -p ${{ env.GEF_PATH_DIR }} ${{ env.GEF_EXTRAS_PATH }} | |
wget -O ${{ env.GEF_PATH }} https://raw.githubusercontent.com/hugsy/gef/${{ env.BRANCH }}/gef.py | |
echo "source ${{ env.GEF_PATH }}" > ~/.gdbinit | |
wget -O ./gef-extras.sh https://github.com/hugsy/gef/raw/${{ env.BRANCH }}/scripts/gef-extras.sh | |
chmod +x ./gef-extras.sh | |
./gef-extras.sh -b ${{ env.BRANCH }} -p ${HOME} | |
gdb -q -ex 'gef missing' -ex quit |