Skip to content

Using action setup-python maintained by https://github.com/ytdl-org/ … #275

Using action setup-python maintained by https://github.com/ytdl-org/ …

Using action setup-python maintained by https://github.com/ytdl-org/ … #275

Workflow file for this run

# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python test
on:
push:
branches: [ "*" ]
pull_request:
branches: [ master ]
jobs:
run_tests:
name: Run Python Tests
strategy:
matrix:
include:
- { os: ubuntu-20.04, python_version: '3.4' }
- { os: ubuntu-20.04, python_version: '3.5' }
- { os: ubuntu-20.04, python_version: '3.6' }
- { os: ubuntu-20.04, python_version: '3.7' }
- { os: ubuntu-22.04, python_version: '3.8' }
- { os: ubuntu-24.04, python_version: '3.9' }
- { os: ubuntu-latest, python_version: '3.10' }
- { os: ubuntu-latest, python_version: '3.11' }
- { os: ubuntu-latest, python_version: '3.12' }
- { os: macos-13, python_version: '3.7' }
- { os: macos-latest, python_version: '3.8' }
- { os: macos-latest, python_version: '3.9' }
- { os: macos-latest, python_version: '3.10' }
- { os: macos-latest, python_version: '3.11' }
- { os: macos-latest, python_version: '3.12' }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up 3.5 Python, ${{ matrix.python_version }}
if: ${{ matrix.python_version == '3.5' }}
uses: actions/setup-python@v5
env:
# Workaround copied from
# https://github.com/ytdl-org/youtube-dl/commit/a08f2b7e4567cdc50c0614ee0a4ffdff49b8b6e6
PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org"
with:
python-version: ${{ matrix.python_version }}
- name: Set up Python ${{ matrix.python_version }}
uses: andreafrancia/setup-python@v1
if: ${{ matrix.python_version != '3.5' }}
with:
python-version: ${{ matrix.python_version }}
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install dependencies
run: python -m pip install -r requirements-dev.txt -r requirements.txt
- name: Check Types
run: ./scripts/check-types
if: matrix.python-version != '2.7'
- name: Run tests
run: python -m pytest
sdist:
name: Test sdist creation
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Test sdist
run: scripts/test-sdist