summaryrefslogtreecommitdiff
path: root/.github/workflows/android.yml
blob: 1a5f6aa7a1573473843120670ec1c6a74b175b48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Android Tests

on: [push, pull_request]

jobs:
  android-test:
    strategy:
      matrix:
        python-version: [3.8]
        os: [ubuntu-latest]
    runs-on: ${{ matrix.os }}
    timeout-minutes: 30
    steps:
    - uses: actions/checkout@v3

    - name: Cache for pip
      uses: actions/cache@v3
      id: cache-pip
      with:
        path: ~/.cache/pip
        key: ${{ matrix.os }}-cache-pip

    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v4
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install Linux dependencies
      run: |
        sudo apt-get update
        sudo apt-get install -y --no-install-recommends -o Acquire::Retries=3 \
          gdb gdbserver socat \
          qemu-user-static \
          binutils-aarch64-linux-gnu \
          binutils-arm-linux-gnueabihf \
          libc6-dbg

    - name: Install Android AVD
      run: |
        source travis/setup_avd_fast.sh
        sed -i 's/skip_android = True/skip_android = False/' docs/source/conf.py
        set | grep ^PATH >.android.env

    - name: Install dependencies
      run: |
        pip install --upgrade pip
        python setup.py egg_info
        pip install --upgrade --editable .

    - name: Sanity checks
      run:  PWNLIB_NOTERM=1 python -c 'from pwn import *; print(pwnlib.term.term_mode)'

    - name: Install documentation dependencies
      run:  pip install -r docs/requirements.txt

    - name: Coverage Doctests (Android Only)
      run: |
        source .android.env
        PWNLIB_NOTERM=1 coverage run -m sphinx -b doctest docs/source docs/build/doctest docs/source/adb.rst