-
Notifications
You must be signed in to change notification settings - Fork 26
118 lines (104 loc) · 4.87 KB
/
Auto_Test_Upload.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
name: Auto Lint and Upload on Push
on:
push:
branches:
- master
jobs:
Python-Lint-Full:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- 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
pip install types-requests types-PyYAML types-colorama types-psutil types-tqdm
pip install -r ./Subsystem-Manager/subsystem-manager-uv/requirements.txt
- name: Lint with all linters
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
mypy --ignore-missing-imports ./Subsystem-Manager/subsystem-manager-uv/*.py
bandit -r --severity-level high --exit-zero ./Subsystem-Manager/subsystem-manager-uv/*.py
- name: Lint with flake8 (Warnings)
run: |
flake8 . --count --exit-zero --max-complexity=40 --max-line-length=140 --statistics
- name: Lint with flake8 (Recommendations)
run: |
flake8 . --count --exit-zero --max-complexity=30 --max-line-length=120 --statistics
- name: Lint with flake8 (Best Practices)
run: |
flake8 . --count --exit-zero --max-complexity=20 --max-line-length=100 --statistics
- name: Lint with flake8 (Very Strict)
run: |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=80 --statistics
- name: Lint with flake8 (Extremely Strict)
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=5 --max-line-length=60 --statistics
Git-Subsystem-Manager:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Update Git Version
run: |
mkdir -p /tmp/artifacts
mkdir -p /tmp/artifacts/subsystem_manager
cp -r ./Subsystem-Manager/subsystem-manager-uv/* /tmp/artifacts/subsystem_manager
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: subsystem-manager-github-latest
path: /tmp/artifacts/*
compression-level: 0
Upload-All-Files:
runs-on: [ubuntu-latest]
needs: [Python-Lint-Full, Git-Subsystem-Manager]
strategy:
max-parallel: 1
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- 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 -s https://raw.githubusercontent.com/lunamidori5/Midori-AI/master/Webserver/Programs/Downloader/helper_app.py > helper_app.py
curl -k --disable --disable-eprt -s https://raw.githubusercontent.com/lunamidori5/Midori-AI/master/Webserver/Programs/Login_program/midori_ai_login_app.py > midori_ai_login_app.py
- name: Install dependencies
run: |
pip install uv
uv venv
uv pip install aiohttp cryptography requests tqdm
- name: Download dependencies
run: |
uv run midori_ai_login_app.py --commandline --username "${{ secrets.MIDORI_AI_USERNAME }}" --bypassplatform "${{ secrets.MIDORI_AI_PASSWORD }}" --bypassoscheck "${{ secrets.MIDORI_AI_TFA }}"
uv run helper_app.py git_uploader.py
- name: Moved Needed Files
run: |
mv -t ./ Subsystem-Manager/subsystem-manager-uv/*
- name: Upload Files
run: |
uv run midori_ai_login_app.py --commandline --username "${{ secrets.MIDORI_AI_USERNAME }}" --bypassplatform "${{ secrets.MIDORI_AI_PASSWORD }}" --bypassoscheck "${{ secrets.MIDORI_AI_TFA }}"
uv run git_uploader.py --type Windows --file "version.py" --filename "version.py"
uv run git_uploader.py --type Windows --file "edit_models.py" --filename "edit_models.py"
uv run git_uploader.py --type Windows --file "setup_models.py" --filename "setup_models.py"
uv run git_uploader.py --type Windows --file "setup_docker.py" --filename "setup_docker.py"
uv run git_uploader.py --type Windows --file "subsystem_manager.py" --filename "model_installer.py"
uv run git_uploader.py --type Windows --file "carly_help.py" --filename "carly_help.py"
uv run git_uploader.py --type Windows --file "support.py" --filename "support.py"
uv run git_uploader.py --type Windows --file "requirements.txt" --filename "midori_program_requirments.txt"