-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
347 additions
and
200 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
name: Continuous Integration | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
python-version: [2.7, 3.8] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache for pip | ||
uses: actions/cache@v1 | ||
id: cache-pip | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ matrix.os }}-cache-pip | ||
|
||
- name: Cache for dependencies | ||
uses: actions/cache@v1 | ||
id: cache-deps | ||
with: | ||
path: android-?dk | ||
key: ${{ matrix.os }}-cache-deps | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Lint | ||
run: | | ||
pip install flake8 | ||
flake8 . --count --select=E9,F63,F7 --show-source --statistics --exclude=android-?dk # TODO: Add F82 | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=pwnlib/constants,android-?dk,.git,__pycache__ | ||
- name: Install Linux dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y --no-install-recommends -o Acquire::Retries=3 \ | ||
ash bash-static dash ksh mksh zsh \ | ||
pandoc gdb socat sshpass \ | ||
binutils-multiarch qemu-user-static \ | ||
binutils-aarch64-linux-gnu \ | ||
binutils-arm-linux-gnueabihf \ | ||
binutils-mips-linux-gnu \ | ||
binutils-powerpc-linux-gnu \ | ||
gcc-multilib \ | ||
openjdk-8-jre-headless | ||
sudo apt-get install -y -o Acquire::Retries=3 \ | ||
gcc-aarch64-linux-gnu \ | ||
gcc-arm-linux-gnueabihf | ||
- name: Install android avd | ||
if: steps.cache-deps.outputs.cache-hit != 'true' | ||
run: | | ||
USER=travis source travis/install.sh | ||
adb emu kill | ||
set | egrep '^(ANDROID|PATH)' >android-sdk/.android.env | ||
- name: Set up SSH | ||
run: | | ||
chmod og-rw ~ # see https://stackoverflow.com/a/60367309/3869724 | ||
ssh-keygen -t ed25519 -f ~/.ssh/pwntools-ci -N '' | ||
cat > ~/.ssh/config <<EOF | ||
Host example.pwnme | ||
User $USER | ||
HostName 127.0.0.1 | ||
IdentityFile ~/.ssh/pwntools-ci | ||
EOF | ||
echo -n 'from="127.0.0.1" ' | cat - ~/.ssh/pwntools-ci.pub > ~/.ssh/authorized_keys | ||
ssh -o 'StrictHostKeyChecking no' example.pwnme id | ||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install --upgrade flake8 appdirs | ||
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 | ||
run: | | ||
source android-sdk/.android.env | ||
android-sdk/emulator/emulator -avd android-$ANDROID_ABI -no-window -no-boot-anim -read-only -no-audio -no-window -no-snapshot & | ||
adb wait-for-device | ||
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope # required by some gdb doctests | ||
PWNLIB_NOTERM=1 coverage run -m sphinx -b doctest docs/source docs/build/doctest | ||
coverage combine | ||
- name: Build source and wheel distributions | ||
run: | | ||
python setup.py sdist | ||
python setup.py bdist_wheel --universal | ||
- uses: actions/upload-artifact@v2-preview | ||
with: | ||
path: dist/* | ||
|
||
- name: Upload coverage to coveralls.io | ||
run: COVERALLS_REPO_TOKEN=PP20MEgztXIQJJTguQwe2jeCh6Bm4lkbv coveralls |
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
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
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
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
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
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
Oops, something went wrong.