2020-11-19 21:46:06 +01:00
|
|
|
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:
|
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: '3.6', python: '3.6', os: ubuntu-latest, architecture: 'x64', cibuild: "no"}
|
2020-09-10 20:13:54 +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"}
|
2020-09-06 15:08:16 +02:00
|
|
|
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 }}
|
2020-10-10 14:03:29 +02:00
|
|
|
key: pip-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('setup.py') }}|${{ hashFiles('requirements*.txt') }}
|
|
|
|
restore-keys: pip-${{ runner.os }}-${{ matrix.python }}-
|
2020-09-06 15:08:16 +02:00
|
|
|
- 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
|
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
|
|
|
|
|
2020-11-19 21:46:06 +01:00
|
|
|
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
|
2020-09-06 15:08:16 +02:00
|
|
|
- name: set version
|
|
|
|
run: python setversion.py
|
|
|
|
|
|
|
|
# Build .zip fil for *nix
|
|
|
|
- run: make
|
2020-11-19 21:46:06 +01:00
|
|
|
- run: ./svtplay-dl --version
|
|
|
|
- name: cibuild
|
|
|
|
run: python scripts/cibuild.py
|
|
|
|
env:
|
|
|
|
CIBUILD: "yes"
|
|
|
|
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
|
|
|
|
2020-11-19 21:46:06 +01:00
|
|
|
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
|
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
|
2020-11-19 21:46:06 +01:00
|
|
|
- name: cibuild
|
|
|
|
run: python scripts/cibuild.py
|
|
|
|
env:
|
|
|
|
CIBUILD: "yes"
|
|
|
|
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
|
|
|
|
2020-11-19 21:46:06 +01:00
|
|
|
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
|
2020-09-06 15:08:16 +02:00
|
|
|
- name: cibuild
|
|
|
|
run: python scripts/cibuild.py
|
|
|
|
env:
|
2020-11-19 21:46:06 +01:00
|
|
|
CIBUILD: "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 }}
|
2020-11-19 21:46:06 +01:00
|
|
|
OS: "ubuntu-latest"
|