-
Notifications
You must be signed in to change notification settings - Fork 178
74 lines (69 loc) · 2.59 KB
/
run-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# 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-latest, python_version: '2.7' }
- { 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