Skip to content

PyPI Tests

PyPI Tests #4

name: PyPI Tests
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Package version to test (e.g., 0.0.3)'
required: false
default: 'latest'
jobs:
wait-for-pypi:
name: "Wait 3min for PyPI"
runs-on: ubuntu-latest
steps:
- name: Wait for PyPI propagation
run: |
echo "Waiting 3 minutes for package to be available on PyPI..."
sleep 180
- name: Ready
run: |
echo "[OK] Package should be available on PyPI now"
# Stage 1: Test on Linux
test-linux:
name: "Linux Py-${{ matrix.python-version }}"
needs: wait-for-pypi
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install from PyPI
run: pip install dtor
- name: Test import
run: |
python -c "import dtor; print('[OK] dtor imported')"
python -c "import dtor; print('Version:', dtor.__version__)"
- name: Check metadata
run: pip show dtor
- name: Test functionality
run: |
python -c "from dtor import TorHandler; h = TorHandler(recover=False); print('[OK] TorHandler initialized')"
# Stage 2: Test on Windows (after Linux)
test-windows:
name: "Windows Py-${{ matrix.python-version }}"
needs: test-linux
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install from PyPI
run: pip install dtor
- name: Test import
run: |
python -c "import dtor; print('[OK] dtor imported')"
python -c "import dtor; print('Version:', dtor.__version__)"
- name: Check metadata
run: pip show dtor
- name: Test functionality
run: |
python -c "from dtor import TorHandler; h = TorHandler(recover=False); print('[OK] TorHandler initialized')"
# Stage 3: Test on macOS (after Windows)
test-macos:
name: "macOS Py-${{ matrix.python-version }}"
needs: test-windows
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install from PyPI
run: pip install dtor
- name: Test import
run: |
python -c "import dtor; print('[OK] dtor imported')"
python -c "import dtor; print('Version:', dtor.__version__)"
- name: Check metadata
run: pip show dtor
- name: Test functionality
run: |
python -c "from dtor import TorHandler; h = TorHandler(recover=False); print('[OK] TorHandler initialized')"
# Stage 4: Final summary
test-complete:
name: "All PyPI Tests Passed"
runs-on: ubuntu-latest
needs: [test-linux, test-windows, test-macos]
steps:
- name: Success
run: |
echo "=========================================="
echo "[OK] PyPI package verified on all platforms"
echo "=========================================="
echo "Platforms tested:"
echo " - Linux (Ubuntu)"
echo " - Windows"
echo " - macOS"
echo ""
echo "Python versions: 3.8, 3.9, 3.10, 3.11, 3.12"
echo "=========================================="
echo ""
echo "Install: pip install dtor"
echo "=========================================="