2020-11-17 19:40:45 +01:00
|
|
|
name: tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
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:
|
2023-01-05 13:33:27 +01:00
|
|
|
python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.9"]
|
2020-11-17 19:40:45 +01:00
|
|
|
|
|
|
|
steps:
|
2022-10-25 15:49:39 +02:00
|
|
|
- uses: actions/checkout@v3
|
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 }}
|
2022-10-25 15:49:39 +02:00
|
|
|
uses: actions/setup-python@v4
|
2020-11-17 19:40:45 +01:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
pip install -r requirements.txt
|
2022-10-03 23:00:01 +02:00
|
|
|
pip install "flake8<4" "importlib-metadata<5"
|
2022-05-23 16:07:01 +02:00
|
|
|
pip install 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
|
|
|
|
;;
|
|
|
|
3.6)
|
|
|
|
# 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)
|
|
|
|
flake8 --extend-exclude scripts/export_tests.py .
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
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
|