-
Notifications
You must be signed in to change notification settings - Fork 26
230 lines (203 loc) · 9.19 KB
/
Auto_Test_Build.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
name: Auto Lint, Test, and Build.
on: [push, pull_request]
jobs:
Python-Lint-Full:
runs-on: [ubuntu-latest]
strategy:
max-parallel: 5
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
conda install flake8 pylint mypy
pip install bandit prospector requests types-requests types-PyYAML types-colorama types-psutil types-tqdm
pip install -r ./other_files/model_installer/requirements.txt
- name: Lint with all linters
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
mypy --ignore-missing-imports ./other_files/model_installer/*.py
bandit -r --severity-level high --exit-zero ./other_files/model_installer/*.py
- name: Lint with flake8 (Warnings)
run: |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics
- name: Lint with flake8 (Recommendations)
run: |
flake8 . --count --exit-zero --max-complexity=15 --max-line-length=100 --statistics
- name: Lint with flake8 (Best Practices)
run: |
flake8 . --count --exit-zero --max-complexity=20 --max-line-length=80 --statistics
- name: Lint with flake8 (Very Strict)
run: |
flake8 . --count --exit-zero --max-complexity=25 --max-line-length=60 --statistics
- name: Lint with flake8 (Extremely Strict)
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=30 --max-line-length=40 --statistics
Upload-All-Files:
runs-on: [ubuntu-latest]
needs: Python-Lint-Full
strategy:
max-parallel: 5
steps:
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Download the Uploader
run: |
curl -O https://tea-cup.midori-ai.xyz/download/midori_ai_downloader && chmod +x midori_ai_downloader
./midori_ai_downloader git_uploader.py
- name: Download Files
run: |
curl -O https://raw.githubusercontent.com/lunamidori5/Midori-AI/master/other_files/model_installer/subsystem_manager.py
curl -O https://raw.githubusercontent.com/lunamidori5/Midori-AI/master/other_files/model_installer/carly_help.py
curl -O https://raw.githubusercontent.com/lunamidori5/Midori-AI/master/other_files/model_installer/setup_docker.py
curl -O https://raw.githubusercontent.com/lunamidori5/Midori-AI/master/other_files/model_installer/setup_models.py
curl -O https://raw.githubusercontent.com/lunamidori5/Midori-AI/master/other_files/model_installer/edit_models.py
curl -O https://raw.githubusercontent.com/lunamidori5/Midori-AI/master/other_files/model_installer/version.py
curl -O https://raw.githubusercontent.com/lunamidori5/Midori-AI/master/other_files/model_installer/support.py
curl -O https://raw.githubusercontent.com/lunamidori5/Midori-AI/master/other_files/model_installer/requirements.txt
curl -O https://raw.githubusercontent.com/lunamidori5/Midori-AI/master/other_files/midori_program_ver.txt
cp ./subsystem_manager.py ./model_installer.py
- name: Install Dependencies
run: |
pip install -r requirements.txt
- name: Upload Files
run: |
python3 git_uploader.py --type Windows --key ${{ secrets.UPLOADER_APIKEY }} --file "version.py" --filename "version.py"
python3 git_uploader.py --type Windows --key ${{ secrets.UPLOADER_APIKEY }} --file "edit_models.py" --filename "edit_models.py"
python3 git_uploader.py --type Windows --key ${{ secrets.UPLOADER_APIKEY }} --file "setup_models.py" --filename "setup_models.py"
python3 git_uploader.py --type Windows --key ${{ secrets.UPLOADER_APIKEY }} --file "setup_docker.py" --filename "setup_docker.py"
python3 git_uploader.py --type Windows --key ${{ secrets.UPLOADER_APIKEY }} --file "model_installer.py" --filename "model_installer.py"
python3 git_uploader.py --type Windows --key ${{ secrets.UPLOADER_APIKEY }} --file "carly_help.py" --filename "carly_help.py"
python3 git_uploader.py --type Windows --key ${{ secrets.UPLOADER_APIKEY }} --file "support.py" --filename "support.py"
Subsystem-Manager-Raw:
strategy:
max-parallel: 5
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python: ['3.10']
runs-on: ${{ matrix.os }}
needs: Upload-All-Files
steps:
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Download the Downloader
run: |
curl -k --disable --disable-eprt https://tea-cup.midori-ai.xyz/download/helper_app.py > helper_app.py
- name: Github Download Files
run: |
curl -O https://raw.githubusercontent.com/lunamidori5/Midori-AI/master/other_files/model_installer/requirements.txt
curl -O https://raw.githubusercontent.com/lunamidori5/Midori-AI/master/other_files/midori_program_ver.txt
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Midori AI Download Files
run: |
python3 helper_app.py model_installer.py
python3 helper_app.py carly_help.py
python3 helper_app.py setup_docker.py
python3 helper_app.py setup_models.py
python3 helper_app.py edit_models.py
python3 helper_app.py support.py
- name: Make EXE file
run: |
pyinstaller --onefile --clean model_installer.py
Subsystem-Manager-Baked:
strategy:
max-parallel: 5
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python: ['3.10']
runs-on: ${{ matrix.os }}
needs: Subsystem-Manager-Raw
steps:
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Download Files
run: |
curl -k --disable --disable-eprt -s https://raw.githubusercontent.com/lunamidori5/Midori-AI/master/other_files/midori_ai_manager/subsystem_python_env_setup.py > subsystem_setup.py
- name: Make EXE file
run: |
python subsystem_setup.py
Test-Build-Subsystem-Manager:
needs: [Subsystem-Manager-Baked]
strategy:
matrix:
os: [ubuntu-20.04, windows-latest, macos-latest]
python: ['3.10']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Update Version Name
run: |
mkdir -p /tmp/artifacts
cp ./other_files/midori_program_ver.txt /tmp/artifacts
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Dependencies
run: |
pip install pyinstaller
pip install -r ./other_files/model_installer/requirements.txt
- name: Build
run: |
pyinstaller --onedir --clean --distpath /tmp/artifacts/${{ matrix.os }}/ --add-data ./other_files/midori_program_ver.txt:. ./other_files/model_installer/subsystem_manager.py
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: subsystem-manager-${{ matrix.os }}
path: /tmp/artifacts/${{ matrix.os }}/*
compression-level: 0
Zip-Tar-All-OS:
needs: [Test-Build-Subsystem-Manager]
container: lunamidori5/linux_model_deb_11:master
runs-on: ubuntu-20.04
steps:
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Fetch Artifacts
uses: actions/download-artifact@v4
- name: Install Dependencies
run: |
mkdir -p /tmp/artifacts
apt-get install -y tree zip
- name: Linux Artifacts
run: |
tar -cvzf model_installer_linux.tar.gz -C subsystem-manager-ubuntu-20.04/subsystem_manager subsystem_manager _internal
cp model_installer_linux.tar.gz /tmp/artifacts/model_installer_linux.tar.gz
- name: Windows Artifacts
run: |
cd subsystem-manager-windows-latest/subsystem_manager
zip -r ../../model_installer_windows.zip subsystem_manager.exe _internal
cd ../../
cp model_installer_windows.zip /tmp/artifacts/model_installer_windows.zip
- name: Mac Artifacts
run: |
cd subsystem-manager-macos-latest/subsystem_manager
zip -r ../../model_installer_mac.zip subsystem_manager _internal
cd ../../
cp model_installer_mac.zip /tmp/artifacts/model_installer_mac.zip
- name: View Artifacts
run: |
tree > /tmp/artifacts/tree.log
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: everything
path: /tmp/artifacts/*
compression-level: 0