2019-06-21 09:56:10 +00:00
|
|
|
name: CI
|
2021-07-24 16:30:45 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test-linux:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
|
|
|
|
steps:
|
|
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: "3.8"
|
|
|
|
|
|
|
|
- name: Cache pip
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
|
|
|
# Look to see if there is a cache hit for the corresponding requirements file
|
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('tox.ini', 'setup.py', 'requirements*.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
${{ runner.os }}-
|
|
|
|
|
|
|
|
- name: Add libtorrent deb repository
|
|
|
|
uses: myci-actions/add-deb-repo@8
|
|
|
|
with:
|
|
|
|
repo: deb http://ppa.launchpad.net/libtorrent.org/1.2-daily/ubuntu focal main
|
|
|
|
repo-name: libtorrent
|
|
|
|
keys: 58E5430D9667FAEFFCA0B93F32309D6B9E009EDB
|
|
|
|
key-server: keyserver.ubuntu.com
|
2021-09-10 18:06:21 +00:00
|
|
|
install: python3-libtorrent-dbg
|
2021-07-24 16:30:45 +00:00
|
|
|
|
2020-05-01 08:37:11 +00:00
|
|
|
- name: Sets env var for security
|
|
|
|
if: (github.event_name == 'pull_request' && contains(github.event.pull_request.body, 'security_test')) || (github.event_name == 'push' && contains(github.event.head_commit.message, 'security_test'))
|
|
|
|
run: echo "SECURITY_TESTS=True" >> $GITHUB_ENV
|
|
|
|
|
2021-07-24 16:30:45 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
pip install --upgrade pip wheel
|
|
|
|
pip install -r requirements.txt -r requirements-tests.txt
|
|
|
|
pip install -e .
|
|
|
|
|
2020-05-01 08:37:11 +00:00
|
|
|
- name: Install security dependencies
|
|
|
|
if: contains(env.SECURITY_TESTS, 'True')
|
|
|
|
run: |
|
|
|
|
wget -O- $TESTSSL_URL$TESTSSL_VER | tar xz
|
|
|
|
mv -t deluge/tests/data testssl.sh-$TESTSSL_VER/testssl.sh testssl.sh-$TESTSSL_VER/etc/;
|
|
|
|
env:
|
|
|
|
TESTSSL_VER: 3.0.6
|
|
|
|
TESTSSL_URL: https://codeload.github.com/drwetter/testssl.sh/tar.gz/refs/tags/v
|
|
|
|
|
2021-09-10 18:06:21 +00:00
|
|
|
- name: Setup core dump directory
|
|
|
|
run: |
|
|
|
|
sudo mkdir /cores/ && sudo chmod 777 /cores/
|
|
|
|
echo "/cores/%E.%p" | sudo tee /proc/sys/kernel/core_pattern
|
|
|
|
|
2021-07-24 16:30:45 +00:00
|
|
|
- name: Test with pytest
|
|
|
|
run: |
|
2021-09-10 18:06:21 +00:00
|
|
|
ulimit -c unlimited # Enable core dumps to be captured
|
2021-07-24 16:30:45 +00:00
|
|
|
cp /usr/lib/python3/dist-packages/libtorrent*.so $GITHUB_WORKSPACE/deluge
|
|
|
|
python -c 'from deluge._libtorrent import lt; print(lt.__version__)';
|
2020-05-01 08:37:11 +00:00
|
|
|
catchsegv python -X dev -m pytest -v -m "not (todo or gtkui)" deluge
|
2021-09-10 18:06:21 +00:00
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
# capture all crashes as build artifacts
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: crashes
|
|
|
|
path: /cores
|
2021-07-24 16:30:45 +00:00
|
|
|
|
|
|
|
test-windows:
|
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
2021-12-12 21:45:57 +00:00
|
|
|
python-version: "3.7"
|
2021-07-24 16:30:45 +00:00
|
|
|
|
|
|
|
- name: Cache pip
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: '%LOCALAPPDATA%\pip\Cache'
|
|
|
|
# Look to see if there is a cache hit for the corresponding requirements file
|
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('tox.ini', 'setup.py', 'requirements*.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
${{ runner.os }}-
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2021-12-12 21:45:57 +00:00
|
|
|
python -m pip install --upgrade pip wheel
|
|
|
|
python -m pip install libtorrent==1.2.*
|
2021-07-24 16:30:45 +00:00
|
|
|
pip install -r requirements.txt -r requirements-tests.txt
|
|
|
|
pip install -e .
|
|
|
|
|
|
|
|
- name: Test with pytest
|
|
|
|
run: |
|
|
|
|
python -c 'import libtorrent as lt; print(lt.__version__)';
|
|
|
|
pytest -m "not (todo or gtkui or security)" deluge
|