2020-12-19 15:17:19 -06:00
|
|
|
name: CI
|
2021-01-13 13:54:38 -06:00
|
|
|
on: [push, pull_request]
|
2020-12-19 15:17:19 -06:00
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
name: Tests
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: true
|
|
|
|
matrix:
|
2023-04-03 15:07:10 -05:00
|
|
|
os: [ubuntu-20.04]
|
2020-12-19 15:17:19 -06:00
|
|
|
# TODO: python 2.6
|
2023-04-03 15:07:10 -05:00
|
|
|
# TODO: restore support for 3.3, 3.4
|
|
|
|
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, pypy-2.7, pypy-3.6, pypy-3.7]
|
2021-01-04 12:34:28 -06:00
|
|
|
python-impl: [cpython]
|
2020-12-19 15:17:19 -06:00
|
|
|
ytdl-test-set: [core, download]
|
|
|
|
run-tests-ext: [sh]
|
|
|
|
include:
|
|
|
|
# python 3.2 is only available on windows via setup-python
|
2022-10-03 18:42:15 -05:00
|
|
|
- os: windows-2019
|
2020-12-19 15:17:19 -06:00
|
|
|
python-version: 3.2
|
2021-01-04 12:34:28 -06:00
|
|
|
python-impl: cpython
|
2020-12-19 15:17:19 -06:00
|
|
|
ytdl-test-set: core
|
|
|
|
run-tests-ext: bat
|
2022-10-03 18:42:15 -05:00
|
|
|
- os: windows-2019
|
2020-12-19 15:17:19 -06:00
|
|
|
python-version: 3.2
|
2021-01-04 12:34:28 -06:00
|
|
|
python-impl: cpython
|
2020-12-19 15:17:19 -06:00
|
|
|
ytdl-test-set: download
|
|
|
|
run-tests-ext: bat
|
2021-01-04 12:34:28 -06:00
|
|
|
# jython
|
2023-04-03 15:07:10 -05:00
|
|
|
- os: ubuntu-20.04
|
2021-01-04 12:34:28 -06:00
|
|
|
python-impl: jython
|
|
|
|
ytdl-test-set: core
|
|
|
|
run-tests-ext: sh
|
2023-04-03 15:07:10 -05:00
|
|
|
- os: ubuntu-20.04
|
2021-01-04 12:34:28 -06:00
|
|
|
python-impl: jython
|
|
|
|
ytdl-test-set: download
|
|
|
|
run-tests-ext: sh
|
2020-12-19 15:17:19 -06:00
|
|
|
steps:
|
2023-04-03 15:07:10 -05:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up supported Python ${{ matrix.python-version }}
|
2023-06-22 11:24:48 -05:00
|
|
|
# wrap broken actions/setup-python@v4
|
|
|
|
uses: ytdl-org/setup-python@v1
|
2020-12-19 15:17:19 -06:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
2023-06-22 11:24:48 -05:00
|
|
|
cache-build: true
|
|
|
|
allow-build: info
|
2021-01-04 12:34:28 -06:00
|
|
|
- name: Set up Java 8
|
|
|
|
if: ${{ matrix.python-impl == 'jython' }}
|
2023-04-03 15:07:10 -05:00
|
|
|
uses: actions/setup-java@v2
|
2021-01-04 12:34:28 -06:00
|
|
|
with:
|
|
|
|
java-version: 8
|
2023-04-03 15:07:10 -05:00
|
|
|
distribution: 'zulu'
|
2021-01-04 12:34:28 -06:00
|
|
|
- name: Install Jython
|
|
|
|
if: ${{ matrix.python-impl == 'jython' }}
|
|
|
|
run: |
|
2021-04-25 14:16:47 -05:00
|
|
|
wget https://repo1.maven.org/maven2/org/python/jython-installer/2.7.1/jython-installer-2.7.1.jar -O jython-installer.jar
|
2021-01-04 12:34:28 -06:00
|
|
|
java -jar jython-installer.jar -s -d "$HOME/jython"
|
|
|
|
echo "$HOME/jython/bin" >> $GITHUB_PATH
|
2020-12-19 15:17:19 -06:00
|
|
|
- name: Install nose
|
2021-04-24 11:52:16 -05:00
|
|
|
if: ${{ matrix.python-impl != 'jython' }}
|
2020-12-19 15:17:19 -06:00
|
|
|
run: pip install nose
|
2021-04-24 11:52:16 -05:00
|
|
|
- name: Install nose (Jython)
|
|
|
|
if: ${{ matrix.python-impl == 'jython' }}
|
|
|
|
# Working around deprecation of support for non-SNI clients at PyPI CDN (see https://status.python.org/incidents/hzmjhqsdjqgb)
|
|
|
|
run: |
|
|
|
|
wget https://files.pythonhosted.org/packages/99/4f/13fb671119e65c4dce97c60e67d3fd9e6f7f809f2b307e2611f4701205cb/nose-1.3.7-py2-none-any.whl
|
|
|
|
pip install nose-1.3.7-py2-none-any.whl
|
2020-12-19 15:17:19 -06:00
|
|
|
- name: Run tests
|
2021-01-04 12:34:28 -06:00
|
|
|
continue-on-error: ${{ matrix.ytdl-test-set == 'download' || matrix.python-impl == 'jython' }}
|
2020-12-19 15:17:19 -06:00
|
|
|
env:
|
|
|
|
YTDL_TEST_SET: ${{ matrix.ytdl-test-set }}
|
|
|
|
run: ./devscripts/run_tests.${{ matrix.run-tests-ext }}
|
|
|
|
flake8:
|
|
|
|
name: Linter
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-04-03 15:07:10 -05:00
|
|
|
- uses: actions/checkout@v3
|
2020-12-19 15:17:19 -06:00
|
|
|
- name: Set up Python
|
2023-04-03 15:07:10 -05:00
|
|
|
uses: actions/setup-python@v4
|
2020-12-19 15:17:19 -06:00
|
|
|
with:
|
|
|
|
python-version: 3.9
|
|
|
|
- name: Install flake8
|
|
|
|
run: pip install flake8
|
|
|
|
- name: Run flake8
|
|
|
|
run: flake8 .
|