-
Notifications
You must be signed in to change notification settings - Fork 122
161 lines (157 loc) · 5.59 KB
/
tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: CI
on: [push, pull_request]
jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {name: '3.12', python: '3.12', os: ubuntu-latest, architecture: 'x64', cibuild: "no"}
- {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: 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@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.architecture }}
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: cache pre-commit
uses: actions/cache@v4
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@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.9'
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
# 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@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.architecture }}
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
- 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@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.9
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
- 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"