mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-08-17 01:26:16 +03:00
* Bump actions/checkout v7.0.0 => v7.0.1 * Bump actions/setup-node v6.4.0 => v7.0.0 * Bump actions/setup-python v6.3.0 => v7.0.0 * Bump denoland/setup-deno v2.0.4 => v2.0.5 * Bump github/codeql-action v4.36.3 => v4.37.7 * Bump pypa/gh-action-pypi-publish v1.14.0 => v1.14.2 * Bump zizmorcore/zizmor-action v0.5.7 => v0.6.2 Authored by: dlp-bot
107 lines
3.8 KiB
YAML
107 lines
3.8 KiB
YAML
name: Challenge Tests
|
|
on:
|
|
push:
|
|
branches: ['master']
|
|
paths:
|
|
- .github/workflows/challenge-tests.yml
|
|
- test/test_jsc/*.py
|
|
- yt_dlp/extractor/youtube/jsc/**.js
|
|
- yt_dlp/extractor/youtube/jsc/**.py
|
|
- yt_dlp/extractor/youtube/pot/**.py
|
|
- yt_dlp/utils/_jsruntime.py
|
|
pull_request:
|
|
branches: ['**']
|
|
paths:
|
|
- .github/workflows/challenge-tests.yml
|
|
- test/test_jsc/*.py
|
|
- yt_dlp/extractor/youtube/jsc/**.js
|
|
- yt_dlp/extractor/youtube/jsc/**.py
|
|
- yt_dlp/extractor/youtube/pot/**.py
|
|
- yt_dlp/utils/_jsruntime.py
|
|
|
|
permissions: {}
|
|
|
|
concurrency:
|
|
group: challenge-tests-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
jobs:
|
|
tests:
|
|
name: Challenge tests
|
|
if: ${{ !contains(github.event.head_commit.message, ':ci skip') }}
|
|
permissions:
|
|
contents: read
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15', pypy-3.11]
|
|
env:
|
|
QJS_VERSION: '2025-04-26' # Earliest version with rope strings
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
allow-prereleases: true
|
|
|
|
- name: Install Deno
|
|
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2.0.5
|
|
with:
|
|
deno-version: '2.3.0' # minimum supported version
|
|
|
|
- name: Install Bun
|
|
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
|
|
with:
|
|
bun-version: '1.2.11' # minimum supported version
|
|
no-cache: true
|
|
|
|
- name: Install Node
|
|
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
with:
|
|
node-version: '22.0' # minimum supported version
|
|
|
|
- name: Install QuickJS (Linux)
|
|
if: matrix.os == 'ubuntu-latest'
|
|
shell: bash
|
|
run: |
|
|
wget "https://bellard.org/quickjs/binary_releases/quickjs-linux-x86_64-${QJS_VERSION}.zip" -O quickjs.zip
|
|
unzip quickjs.zip qjs
|
|
sudo install qjs /usr/local/bin/qjs
|
|
|
|
- name: Install QuickJS (Windows)
|
|
if: matrix.os == 'windows-latest'
|
|
shell: pwsh
|
|
run: |
|
|
$ErrorActionPreference = "Stop"
|
|
$PSNativeCommandUseErrorActionPreference = $true
|
|
Invoke-WebRequest "https://bellard.org/quickjs/binary_releases/quickjs-win-x86_64-${Env:QJS_VERSION}.zip" -OutFile quickjs.zip
|
|
unzip quickjs.zip
|
|
|
|
- name: Install test requirements (cpython)
|
|
if: ${{ !startsWith(matrix.python-version, 'pypy') }}
|
|
run: |
|
|
python -m pip install -U --require-hashes -r "bundle/requirements/pip.txt"
|
|
python -m pip install -U --require-hashes -r "bundle/requirements/test.txt"
|
|
python -m pip install -U --require-hashes -r "bundle/requirements/default.txt"
|
|
|
|
- name: Install test requirements (PyPy)
|
|
if: ${{ startsWith(matrix.python-version, 'pypy') }}
|
|
run: |
|
|
# Upgrading/downgrading pip on Windows with actions/setup-python's PyPy can cause breakage
|
|
# See https://github.com/actions/setup-python/issues/1348
|
|
python -m pip install -U --require-hashes -r "bundle/requirements/test.txt"
|
|
python -m pip install -U --require-hashes -r "bundle/requirements/default.txt"
|
|
|
|
- name: Run tests
|
|
timeout-minutes: 15
|
|
shell: bash
|
|
run: |
|
|
python -m yt_dlp -v --js-runtimes node --js-runtimes bun --js-runtimes quickjs || true
|
|
python ./devscripts/run_tests.py test/test_jsc -k download
|