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:
|
2023-05-30 16:12:35 +00:00
|
|
|
inputs:
|
|
|
|
core-dump:
|
|
|
|
description: "Set to 1 to enable retrieving core dump from crashes"
|
|
|
|
default: "0"
|
2021-07-24 16:30:45 +00:00
|
|
|
jobs:
|
|
|
|
test-linux:
|
2023-05-30 16:12:35 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2022-02-05 22:35:50 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
python-version: ["3.7", "3.10"]
|
2021-07-24 16:30:45 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
2024-06-23 01:36:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2021-07-24 16:30:45 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Set up Python
|
2024-06-23 01:36:06 +00:00
|
|
|
uses: actions/setup-python@v5
|
2021-07-24 16:30:45 +00:00
|
|
|
with:
|
2022-02-05 22:35:50 +00:00
|
|
|
python-version: ${{ matrix.python-version }}
|
2022-03-02 13:08:02 +00:00
|
|
|
cache: "pip"
|
|
|
|
cache-dependency-path: "requirements*.txt"
|
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: |
|
2023-09-18 10:45:01 +00:00
|
|
|
pip install --upgrade pip wheel setuptools
|
2023-11-19 21:13:42 +00:00
|
|
|
pip install -r requirements-ci.txt
|
2021-07-24 16:30:45 +00:00
|
|
|
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
|
|
|
|
|
2023-05-30 16:12:35 +00:00
|
|
|
- name: Setup core dump catch and store
|
|
|
|
if: github.event.inputs.core-dump == '1'
|
2021-09-10 18:06:21 +00:00
|
|
|
run: |
|
|
|
|
sudo mkdir /cores/ && sudo chmod 777 /cores/
|
|
|
|
echo "/cores/%E.%p" | sudo tee /proc/sys/kernel/core_pattern
|
2023-05-30 16:12:35 +00:00
|
|
|
ulimit -c unlimited
|
|
|
|
sudo apt install glibc-tools
|
|
|
|
echo "DEBUG_PREFIX=catchsegv python -X dev -m" >> $GITHUB_ENV
|
2021-09-10 18:06:21 +00:00
|
|
|
|
2021-07-24 16:30:45 +00:00
|
|
|
- name: Test with pytest
|
|
|
|
run: |
|
|
|
|
python -c 'from deluge._libtorrent import lt; print(lt.__version__)';
|
2023-05-30 16:12:35 +00:00
|
|
|
$DEBUG_PREFIX pytest -v -m "not (todo or gtkui)" deluge
|
2021-09-10 18:06:21 +00:00
|
|
|
|
2024-06-23 01:36:06 +00:00
|
|
|
- uses: actions/upload-artifact@v4
|
2021-09-10 18:06:21 +00:00
|
|
|
# capture all crashes as build artifacts
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: crashes
|
|
|
|
path: /cores
|
2021-07-24 16:30:45 +00:00
|
|
|
|
|
|
|
test-windows:
|
2023-05-30 16:12:35 +00:00
|
|
|
runs-on: windows-2022
|
2022-02-05 22:35:50 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
python-version: ["3.7", "3.10"]
|
2021-07-24 16:30:45 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
2024-06-23 01:36:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2021-07-24 16:30:45 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Set up Python
|
2024-06-23 01:36:06 +00:00
|
|
|
uses: actions/setup-python@v5
|
2021-07-24 16:30:45 +00:00
|
|
|
with:
|
2022-02-05 22:35:50 +00:00
|
|
|
python-version: ${{ matrix.python-version }}
|
2022-03-02 13:08:02 +00:00
|
|
|
cache: "pip"
|
|
|
|
cache-dependency-path: "requirements*.txt"
|
2021-07-24 16:30:45 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2023-09-18 10:45:01 +00:00
|
|
|
pip install --upgrade pip wheel setuptools
|
2023-11-19 21:13:42 +00:00
|
|
|
pip install -r requirements-ci.txt
|
2021-07-24 16:30:45 +00:00
|
|
|
pip install -e .
|
|
|
|
|
|
|
|
- name: Test with pytest
|
|
|
|
run: |
|
|
|
|
python -c 'import libtorrent as lt; print(lt.__version__)';
|
2021-12-29 18:06:10 +00:00
|
|
|
pytest -v -m "not (todo or gtkui or security)" deluge
|