mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-30 15:14:14 +01:00
194 lines
7.2 KiB
YAML
194 lines
7.2 KiB
YAML
name: CI
|
|
on: [push, pull_request]
|
|
jobs:
|
|
tests:
|
|
name: ${{ matrix.name }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- {name: '3.11', python: '3.11', os: ubuntu-latest, architecture: 'x64', cibuild: "no"}
|
|
- {name: '3.10', python: '3.10', os: ubuntu-latest, architecture: 'x64', cibuild: "no"}
|
|
- {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"}
|
|
- {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"}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
architecture: ${{ matrix.architecture }}
|
|
- name: update pip
|
|
run: |
|
|
pip install -U wheel
|
|
pip install -U setuptools
|
|
python -m pip install -U pip
|
|
- name: get pip cache dir
|
|
id: pip-cache
|
|
run: echo "::set-output name=dir::$(pip cache dir)"
|
|
- name: cache pip
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ steps.pip-cache.outputs.dir }}
|
|
key: pip-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('setup.py') }}|${{ hashFiles('requirements*.txt') }}
|
|
restore-keys: pip-${{ runner.os }}-${{ matrix.python }}-
|
|
- name: install deps
|
|
run: |
|
|
pip install -r requirements.txt
|
|
pip install -r requirements-dev.txt
|
|
- name: cache pre-commit
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.cache/pre-commit
|
|
key: per-commit|${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('.pre-commit-config.yaml') }}
|
|
restore-keys: per-commit|${{ runner.os }}-${{ matrix.python }}-
|
|
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:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: '3.9'
|
|
- name: update pip
|
|
run: |
|
|
pip install -U setuptools
|
|
python -m pip install -U pip
|
|
- name: get pip cache dir
|
|
id: pip-cache
|
|
run: echo "::set-output name=dir::$(pip cache dir)"
|
|
- name: cache pip
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ steps.pip-cache.outputs.dir }}
|
|
key: pip-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('setup.py') }}|${{ hashFiles('requirements*.txt') }}
|
|
restore-keys: pip-${{ runner.os }}-${{ matrix.python }}-
|
|
- name: install deps
|
|
run: |
|
|
pip install -r requirements.txt
|
|
pip install -r requirements-dev.txt
|
|
|
|
# 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"
|
|
|
|
binaries-exe:
|
|
name: "binaries exe ${{ matrix.architecture }}"
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- {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:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
architecture: ${{ matrix.architecture }}
|
|
- name: update pip
|
|
run: |
|
|
pip install -U wheel
|
|
pip install -U setuptools
|
|
python -m pip install -U pip
|
|
- name: get pip cache dir
|
|
id: pip-cache
|
|
run: echo "::set-output name=dir::$(pip cache dir)"
|
|
- name: cache pip
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ steps.pip-cache.outputs.dir }}
|
|
key: pip-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('setup.py') }}|${{ hashFiles('requirements*.txt') }}
|
|
restore-keys: pip-${{ runner.os }}-${{ matrix.python }}-
|
|
- name: install deps
|
|
run: |
|
|
pip install -r requirements.txt
|
|
pip install -r requirements-dev.txt
|
|
- name: set version
|
|
run: python setversion.py
|
|
- 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"
|
|
|
|
binaries-pypi:
|
|
name: "binaries pypi"
|
|
runs-on: "ubuntu-latest"
|
|
strategy:
|
|
fail-fast: false
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.9
|
|
- name: update pip
|
|
run: |
|
|
pip install -U setuptools
|
|
python -m pip install -U pip
|
|
- name: get pip cache dir
|
|
id: pip-cache
|
|
run: echo "::set-output name=dir::$(pip cache dir)"
|
|
- name: cache pip
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ steps.pip-cache.outputs.dir }}
|
|
key: pip-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('setup.py') }}|${{ hashFiles('requirements*.txt') }}
|
|
restore-keys: pip-${{ runner.os }}-${{ matrix.python }}-
|
|
- 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
|
|
- name: cibuild
|
|
run: python scripts/cibuild.py
|
|
env:
|
|
CIBUILD: "yes"
|
|
BUILD_DOCKER: "yes"
|
|
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 }}
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
OS: "ubuntu-latest"
|