2020-11-17 19:40:45 +01:00
|
|
|
name: tests
|
|
|
|
|
|
|
|
on:
|
2024-03-03 18:10:55 +01:00
|
|
|
workflow_dispatch:
|
2020-11-17 19:40:45 +01:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
2023-01-05 13:33:27 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-17 19:40:45 +01:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-09-28 16:48:21 +02:00
|
|
|
python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.9"]
|
2020-11-17 19:40:45 +01:00
|
|
|
|
|
|
|
steps:
|
2023-12-02 13:56:21 +01:00
|
|
|
- uses: actions/checkout@v4
|
2020-11-17 19:40:45 +01:00
|
|
|
|
2023-06-25 00:48:40 +02:00
|
|
|
- name: Check file permissions
|
2023-06-19 17:53:40 +02:00
|
|
|
run: |
|
2023-06-25 00:48:40 +02:00
|
|
|
if [[ "$(find ./gallery_dl -type f -not -perm 644)" ]]; then exit 1; fi
|
2023-06-19 17:53:40 +02:00
|
|
|
|
2020-11-17 19:40:45 +01:00
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2024-03-09 23:32:31 +01:00
|
|
|
uses: actions/setup-python@v5
|
2020-11-17 19:40:45 +01:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
2024-06-02 01:32:54 +02:00
|
|
|
env:
|
|
|
|
PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org"
|
2020-11-17 19:40:45 +01:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
pip install -r requirements.txt
|
2023-09-15 14:19:47 +02:00
|
|
|
pip install flake8 youtube-dl
|
2023-05-01 16:31:26 +02:00
|
|
|
|
|
|
|
- name: Install yt-dlp
|
|
|
|
run: |
|
|
|
|
case "${{ matrix.python-version }}" in
|
|
|
|
3.4|3.5)
|
|
|
|
# don't install yt-dlp
|
|
|
|
;;
|
2024-09-28 16:48:21 +02:00
|
|
|
3.6|3.7|3.8)
|
2023-05-01 16:31:26 +02:00
|
|
|
# install from PyPI
|
|
|
|
pip install yt-dlp
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# install from master
|
|
|
|
pip install https://github.com/yt-dlp/yt-dlp/archive/refs/heads/master.tar.gz
|
|
|
|
;;
|
|
|
|
esac
|
2020-11-17 19:40:45 +01:00
|
|
|
|
|
|
|
- name: Lint with flake8
|
|
|
|
run: |
|
2023-09-14 18:49:58 +02:00
|
|
|
case "${{ matrix.python-version }}" in
|
|
|
|
3.4|3.5|3.6|3.7)
|
2024-02-27 19:07:52 +01:00
|
|
|
flake8 --extend-exclude scripts/export_tests.py,scripts/pyprint.py .
|
2023-09-14 18:49:58 +02:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
flake8 .
|
|
|
|
;;
|
|
|
|
esac
|
2020-11-17 19:40:45 +01:00
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: |
|
|
|
|
make test
|
|
|
|
|
2022-10-25 15:48:37 +02:00
|
|
|
- name: Test autogeneration of man pages, bash/zsh/fish completion, etc
|
2020-11-17 19:40:45 +01:00
|
|
|
run: |
|
2021-02-21 22:57:37 +01:00
|
|
|
make
|