1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00
svtplay-dl/.github/workflows/tests.yaml

162 lines
5.6 KiB
YAML
Raw Normal View History

name: CI
on: [push, pull_request]
2020-09-06 15:08:16 +02:00
jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
2022-11-30 22:41:39 +01:00
- {name: '3.11', python: '3.11', os: ubuntu-latest, architecture: 'x64', cibuild: "no"}
2021-10-20 15:02:11 +02:00
- {name: '3.10', python: '3.10', os: ubuntu-latest, architecture: 'x64', cibuild: "no"}
2020-10-09 10:55:51 +02:00
- {name: '3.9', python: '3.9', os: ubuntu-latest, architecture: 'x64', cibuild: "yes"}
- {name: '3.8', python: '3.8', os: ubuntu-latest, architecture: 'x64', cibuild: "no"}
2020-09-06 15:08:16 +02:00
- {name: '3.7', python: '3.7', os: ubuntu-latest, architecture: 'x64', cibuild: "no"}
- {name: Windows, python: '3.8', os: windows-latest, architecture: 'x64', arch-cx: 'win-amd64', cx_name: 'amd64', cibuild: "yes"}
- {name: WindowsX86, python: '3.8', os: windows-latest, architecture: 'x86', arch-cx: 'win32', cx_name: 'win32', cibuild: "yes"}
2020-09-06 15:08:16 +02:00
steps:
2023-07-18 23:39:09 +02:00
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
2020-09-06 15:08:16 +02:00
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.architecture }}
2023-07-18 23:39:09 +02:00
cache: 'pip'
2020-09-06 15:08:16 +02:00
- name: update pip
run: |
pip install -U wheel
pip install -U setuptools
python -m pip install -U pip
- name: install deps
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: cache pre-commit
2023-07-18 23:39:09 +02:00
uses: actions/cache@v3
2020-09-06 15:08:16 +02:00
with:
path: ~/.cache/pre-commit
2020-10-10 14:03:29 +02:00
key: per-commit|${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: per-commit|${{ runner.os }}-${{ matrix.python }}-
2020-09-06 15:08:16 +02:00
if: matrix.os == 'ubuntu-latest'
- name: pre-commit
run: pre-commit run --all-files --show-diff-on-failure
if: matrix.os == 'ubuntu-latest'
- name: pytest
run: pytest -v --cov
binaries-make:
name: "binaries make"
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
steps:
2023-07-18 23:39:09 +02:00
- uses: actions/checkout@v3
with:
fetch-depth: 0
2023-07-18 23:39:09 +02:00
- uses: actions/setup-python@v4
with:
python-version: '3.9'
2023-07-18 23:39:09 +02:00
cache: 'pip'
- name: update pip
run: |
pip install -U setuptools
python -m pip install -U pip
- name: install deps
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt
2020-09-06 15:08:16 +02:00
# Build .zip fil for *nix
- run: make
- run: ./svtplay-dl --version
- name: cibuild
run: python scripts/cibuild.py
env:
CIBUILD: "yes"
BUILD_DOCKER: "no"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
OS: "ubuntu-latest"
2020-09-06 15:08:16 +02:00
binaries-exe:
name: "binaries exe ${{ matrix.architecture }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
2022-06-06 08:05:34 +02:00
- {name: Windows, python: '3.8', os: windows-latest, architecture: 'x64', arch-cx: 'win-amd64', cx_name: 'amd64', cibuild: "yes"}
- {name: WindowsX86, python: '3.8', os: windows-latest, architecture: 'x86', arch-cx: 'win32', cx_name: 'win32', cibuild: "yes"}
steps:
2023-07-18 23:39:09 +02:00
- uses: actions/checkout@v3
with:
fetch-depth: 0
2023-07-18 23:39:09 +02:00
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.architecture }}
2023-07-18 23:39:09 +02:00
cache: 'pip'
- name: update pip
run: |
pip install -U wheel
pip install -U setuptools
python -m pip install -U pip
- name: install deps
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: set version
run: python setversion.py
2020-09-06 15:08:16 +02:00
- name: build .exe
run: python setup.py build_exe
- name: run the .exe file
run: build\\exe.${{ matrix.arch-cx }}-${{ matrix.python }}\\svtplay-dl.exe --version
- run: |
mkdir svtplay-dl
xcopy /s build\\exe.${{ matrix.arch-cx }}-${{ matrix.python }} svtplay-dl
- run: 7z a -tzip svtplay-dl-${{ matrix.cx_name }}.zip svtplay-dl
- name: cibuild
run: python scripts/cibuild.py
env:
CIBUILD: "yes"
BUILD_DOCKER: "no"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
OS: "windows-latest"
2020-09-06 15:08:16 +02:00
binaries-pypi:
name: "binaries pypi"
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
steps:
2023-07-18 23:39:09 +02:00
- uses: actions/checkout@v3
with:
fetch-depth: 0
2023-07-18 23:39:09 +02:00
- uses: actions/setup-python@v4
with:
python-version: 3.9
2023-07-18 23:39:09 +02:00
cache: 'pip'
- name: update pip
run: |
pip install -U setuptools
python -m pip install -U pip
- name: install deps
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: python pkg
run: python setup.py sdist bdist_wheel
2020-09-06 15:08:16 +02:00
- name: cibuild
run: python scripts/cibuild.py
env:
CIBUILD: "yes"
BUILD_DOCKER: "yes"
2020-09-06 15:08:16 +02:00
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
2020-09-08 22:42:42 +02:00
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
OS: "ubuntu-latest"