Integrate typing into source #1254
Workflow file for this run
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
name: Release Tests | |
on: | |
schedule: | |
- cron: 16 6 * * * | |
push: | |
branches: [ main ] | |
pull_request: | |
workflow_dispatch: | |
workflow_call: | |
# cancels running CI if new commit is pushed to branch | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
LATEST_PYTHON_VER: 3.11 | |
LATEST_QBT_VER: v4.5.5 | |
QBITTORRENTAPI_HOST: localhost:8080 | |
QBITTORRENTAPI_USERNAME: admin | |
QBITTORRENTAPI_PASSWORD: adminadmin | |
FORCE_COLOR: 1 | |
jobs: | |
verify: | |
name: Get Ready | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
outputs: | |
python-latest-version: ${{ steps.set-outputs.outputs.python-latest-version }} | |
qbittorrent-latest-version: ${{ steps.set-outputs.outputs.qbittorrent-latest-version }} | |
qbittorrent-host: ${{ steps.set-outputs.outputs.qbittorrent-host }} | |
qbittorrent-username: ${{ steps.set-outputs.outputs.qbittorrent-username }} | |
qbittorrent-password: ${{ steps.set-outputs.outputs.qbittorrent-password }} | |
steps: | |
- name: Declare Outputs | |
id: set-outputs | |
run: | | |
echo "python-latest-version=${{ env.LATEST_PYTHON_VER }}" >> ${GITHUB_OUTPUT} | |
echo "qbittorrent-latest-version=${{ env.LATEST_QBT_VER }}" >> ${GITHUB_OUTPUT} | |
echo "qbittorrent-host=${{ env.QBITTORRENTAPI_HOST }}" >> ${GITHUB_OUTPUT} | |
echo "qbittorrent-username=${{ env.QBITTORRENTAPI_USERNAME }}" >> ${GITHUB_OUTPUT} | |
echo "qbittorrent-password=${{ env.QBITTORRENTAPI_PASSWORD }}" >> ${GITHUB_OUTPUT} | |
- name: Checkout Repo | |
uses: actions/checkout@v4.1.0 | |
- name: Set up Python ${{ env.LATEST_PYTHON_VER }} | |
uses: actions/setup-python@v4.7.0 | |
with: | |
python-version: ${{ env.LATEST_PYTHON_VER }} | |
cache: pip | |
check-latest: true | |
cache-dependency-path: ${{ github.workspace }}/setup.cfg | |
- name: Install | |
run: pip install .[dev] | |
- name: Lint | |
uses: pre-commit/action@v3.0.0 | |
package: | |
####### | |
# Verify build and packaging is successful | |
####### | |
name: Build & Verify Package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4.1.0 | |
- name: Set up Python ${{ env.LATEST_PYTHON_VER }} | |
uses: actions/setup-python@v4.7.0 | |
with: | |
python-version: ${{ env.LATEST_PYTHON_VER }} | |
cache: pip | |
cache-dependency-path: ${{ github.workspace }}/setup.cfg | |
- name: Install Build Tools | |
run: | | |
python -m pip install -U pip setuptools wheel | |
python -m pip install .[dev] | |
- name: Build Package | |
run: tox -e package | |
- name: Upload Package | |
uses: actions/upload-artifact@v3.1.3 | |
with: | |
name: package | |
path: ./dist | |
if-no-files-found: error | |
Tests-qBittorrent: | |
name: Release Test ${{ needs.verify.outputs.python-latest-version }} - ${{ matrix.QBT_VER }} | |
needs: [ verify, package ] | |
strategy: | |
matrix: | |
QBT_VER: | |
- v4.6.0rc2 | |
- v4.4.4 | |
- v4.3.9 | |
- v4.3.5 | |
- v4.3.4.1 | |
- v4.3.3 | |
- v4.3.2 | |
- v4.3.1 | |
- v4.3.0.1 | |
- v4.2.5 | |
- v4.2.0 | |
- v4.1.6 | |
- v4.1.0 | |
include: | |
- IS_QBT_DEV: false | |
# test dev versions of qBittorrent | |
- QBT_VER: master | |
IS_QBT_DEV: true | |
- QBT_VER: v4_5_x | |
IS_QBT_DEV: true | |
- QBT_VER: v4_4_x | |
IS_QBT_DEV: true | |
- QBT_VER: v4_3_x | |
IS_QBT_DEV: true | |
uses: ./.github/workflows/test.yml | |
secrets: inherit | |
with: | |
python-version: ${{ needs.verify.outputs.python-latest-version }} | |
qbittorrent-version: ${{ matrix.QBT_VER }} | |
qbittorrent-host: ${{ needs.verify.outputs.qbittorrent-host }} | |
qbittorrent-username: ${{ needs.verify.outputs.qbittorrent-username }} | |
qbittorrent-password: ${{ needs.verify.outputs.qbittorrent-password }} | |
is-qbt-dev: ${{ matrix.IS_QBT_DEV }} | |
Tests-Python: | |
name: Release Test ${{ matrix.PYTHON_VER }} - ${{ needs.verify.outputs.qbittorrent-latest-version }} | |
needs: [ verify, package ] | |
strategy: | |
matrix: | |
PYTHON_VER: [ 3.12-dev, 3.11, "3.10", pypy3.10, 3.9, 3.8 ] | |
uses: ./.github/workflows/test.yml | |
secrets: inherit | |
with: | |
python-version: ${{ matrix.PYTHON_VER }} | |
qbittorrent-version: ${{ needs.verify.outputs.qbittorrent-latest-version }} | |
qbittorrent-host: ${{ needs.verify.outputs.qbittorrent-host }} | |
qbittorrent-username: ${{ needs.verify.outputs.qbittorrent-username }} | |
qbittorrent-password: ${{ needs.verify.outputs.qbittorrent-password }} | |
is-qbt-dev: false | |
coverage: | |
name: Combine & Check Coverage | |
runs-on: ubuntu-latest | |
needs: [ Tests-qBittorrent, Tests-Python ] | |
steps: | |
- uses: actions/checkout@v4.1.0 | |
with: | |
fetch-depth: 0 | |
- name: Setup Python | |
uses: actions/setup-python@v4.7.0 | |
with: | |
python-version: 3.x | |
- name: Install dev dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools | |
python -m pip install -e .[dev] | |
- name: Retrieve coverage data | |
uses: actions/download-artifact@v3.0.2 | |
with: | |
name: coverage-data | |
- name: Combine coverage | |
run: python -m coverage combine | |
- name: Generate coverage report | |
id: coverage | |
run: | | |
python -m coverage html --skip-covered --skip-empty | |
python -m coverage report --fail-under=100 | |
- name: Upload HTML coverage report | |
if: always() && steps.coverage.outcome == 'failure' | |
uses: actions/upload-artifact@v3.1.3 | |
with: | |
name: html-coverage-report | |
path: ./htmlcov | |
- name: Upload Coverage to Codecov | |
if: contains(fromJson('["push", "pull_request"]'), github.event_name) | |
uses: codecov/codecov-action@v3.1.4 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
install-dev: | |
####### | |
# Verify package can be installed on all platforms | |
####### | |
name: Verify Dev Install | |
needs: [ verify ] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest ] | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4.1.0 | |
- name: Set up Python ${{ env.LATEST_PYTHON_VER }} | |
uses: actions/setup-python@v4.7.0 | |
with: | |
python-version: ${{ env.LATEST_PYTHON_VER }} | |
cache: pip | |
cache-dependency-path: ${{ github.workspace }}/setup.cfg | |
- name: Install in Dev Mode | |
run: | | |
python -m pip install -U pip wheel setuptools | |
python -m pip install -e .[dev] | |
- name: Import Package | |
run: python -c "from qbittorrentapi import Client; assert Client().host == 'localhost:8080'" |