pwndbg/.github/workflows/tests.yml

78 lines
1.9 KiB
YAML

name: Unit tests
on: [push, pull_request]
jobs:
tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-20.04, ubuntu-18.04]
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- name: Cache for pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ matrix.os }}-cache-pip
- name: Install dependencies
run: |
./setup.sh --user
./setup-dev.sh --user
pip install --user coveralls
- name: Python version info
run: |
echo 'GDB py:'
gdb --batch --quiet --nx --nh --ex 'py import sys; print(sys.version)'
echo 'Installed py:'
python -V
echo 'Installed packages:'
python -m pip freeze
# We set `kernel.yama.ptrace_scope=0` for `attachp` command tests
- name: Run tests
run: |
mkdir .cov
sudo sysctl -w kernel.yama.ptrace_scope=0
PWNDBG_GITHUB_ACTIONS_TEST_RUN=1 ./tests.sh --cov
- name: Process coverage data
if: matrix.os == 'ubuntu-22.04'
run: |
coverage combine
coverage xml
- name: "Upload coverage to Codecov"
if: matrix.os == 'ubuntu-22.04'
uses: codecov/codecov-action@v3
qemu-tests:
runs-on: [ubuntu-22.04]
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- name: Cache for pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ matrix.os }}-cache-pip
- name: Install dependencies
run: |
./setup.sh --user
./setup-dev.sh --user
- name: Download images
run: |
./tests/qemu-tests/download_images.sh
# We set `kernel.yama.ptrace_scope=0` for `gdb-pt-dump`
- name: Run tests
run: |
sudo sysctl -w kernel.yama.ptrace_scope=0
./tests/qemu-tests/tests.sh