1
+ name : Auto Debug and Upload
2
+
3
+ on : push
4
+
5
+ jobs :
6
+ Python-Lint-Full :
7
+ runs-on : [ubuntu-latest]
8
+ strategy :
9
+ max-parallel : 5
10
+
11
+ steps :
12
+ - uses : actions/checkout@v4
13
+ - name : Set up Python 3.10
14
+ uses : actions/setup-python@v5
15
+ with :
16
+ python-version : ' 3.10'
17
+ - name : Add conda to system path
18
+ run : |
19
+ # $CONDA is an environment variable pointing to the root of the miniconda directory
20
+ echo $CONDA/bin >> $GITHUB_PATH
21
+ - name : Install dependencies
22
+ run : |
23
+ conda install flake8 pylint mypy
24
+ pip install bandit prospector requests types-requests types-PyYAML types-colorama types-psutil types-tqdm
25
+ pip install -r ./other_files/model_installer/requirements.txt
26
+ - name : Lint with all linters
27
+ run : |
28
+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
29
+ mypy --ignore-missing-imports ./other_files/model_installer/*.py
30
+ bandit -r --severity-level high --exit-zero ./other_files/model_installer/*.py
31
+ - name : Lint with flake8 (Warnings)
32
+ run : |
33
+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics
34
+ - name : Lint with flake8 (Recommendations)
35
+ run : |
36
+ flake8 . --count --exit-zero --max-complexity=15 --max-line-length=100 --statistics
37
+ - name : Lint with flake8 (Best Practices)
38
+ run : |
39
+ flake8 . --count --exit-zero --max-complexity=20 --max-line-length=80 --statistics
40
+ - name : Lint with flake8 (Very Strict)
41
+ run : |
42
+ flake8 . --count --exit-zero --max-complexity=25 --max-line-length=60 --statistics
43
+ - name : Lint with flake8 (Extremely Strict)
44
+ run : |
45
+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
46
+ flake8 . --count --exit-zero --max-complexity=30 --max-line-length=40 --statistics
47
+
48
+ Subsystem-Manager-Baked :
49
+ strategy :
50
+ max-parallel : 5
51
+ matrix :
52
+ os : [ubuntu-latest, windows-latest, macos-latest]
53
+ python : ['3.10']
54
+ runs-on : ${{ matrix.os }}
55
+ needs : Python-Lint-Full
56
+
57
+ steps :
58
+ - name : Set up Python 3.10
59
+ uses : actions/setup-python@v5
60
+ with :
61
+ python-version : ' 3.10'
62
+ - name : Download Files
63
+ run : |
64
+ 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
65
+ - name : Make EXE file
66
+ run : |
67
+ python subsystem_setup.py
68
+
69
+ Test-Build-Subsystem-Manager :
70
+ needs : [Subsystem-Manager-Baked]
71
+ strategy :
72
+ matrix :
73
+ os : [ubuntu-20.04, windows-latest, macos-latest]
74
+ python : ['3.10']
75
+ runs-on : ${{ matrix.os }}
76
+ steps :
77
+ - uses : actions/checkout@v4
78
+
79
+ - name : Update Version Name
80
+ run : |
81
+ mkdir -p /tmp/artifacts
82
+ cp ./other_files/midori_program_ver.txt /tmp/artifacts
83
+
84
+ - uses : actions/setup-python@v5
85
+ with :
86
+ python-version : ${{ matrix.python }}
87
+
88
+ - name : Install Dependencies
89
+ run : |
90
+ pip install pyinstaller
91
+ pip install -r ./other_files/model_installer/requirements.txt
92
+
93
+ - name : Build
94
+ run : |
95
+ pyinstaller --onedir --clean --distpath /tmp/artifacts/${{ matrix.os }}/ --add-data ./other_files/midori_program_ver.txt:. ./other_files/model_installer/subsystem_manager.py
96
+
97
+ - name : ' Upload Artifact'
98
+ uses : actions/upload-artifact@v4
99
+ with :
100
+ name : subsystem-manager-${{ matrix.os }}
101
+ path : /tmp/artifacts/${{ matrix.os }}/*
102
+ compression-level : 0
103
+
104
+ Zip-Tar-All-OS :
105
+ needs : [Test-Build-Subsystem-Manager]
106
+ container : lunamidori5/linux_model_deb_11:master
107
+ runs-on : ubuntu-20.04
108
+ steps :
109
+ - name : Set up Python 3.10
110
+ uses : actions/setup-python@v5
111
+ with :
112
+ python-version : ' 3.10'
113
+
114
+ - name : Fetch Artifacts
115
+ uses : actions/download-artifact@v4
116
+
117
+ - name : Install Dependencies
118
+ run : |
119
+ mkdir -p /tmp/artifacts
120
+ apt-get install -y tree zip
121
+
122
+ - name : Linux Artifacts
123
+ run : |
124
+ tar -cvzf model_installer_linux.tar.gz -C subsystem-manager-ubuntu-20.04/subsystem_manager subsystem_manager _internal
125
+ cp model_installer_linux.tar.gz /tmp/artifacts/model_installer_linux.tar.gz
126
+
127
+ - name : Windows Artifacts
128
+ run : |
129
+ cd subsystem-manager-windows-latest/subsystem_manager
130
+ zip -r ../../model_installer_windows.zip subsystem_manager.exe _internal
131
+ cd ../../
132
+ cp model_installer_windows.zip /tmp/artifacts/model_installer_windows.zip
133
+
134
+ - name : Mac Artifacts
135
+ run : |
136
+ cd subsystem-manager-macos-latest/subsystem_manager
137
+ zip -r ../../model_installer_mac.zip subsystem_manager _internal
138
+ cd ../../
139
+ cp model_installer_mac.zip /tmp/artifacts/model_installer_mac.zip
140
+
141
+ - name : View Artifacts
142
+ run : |
143
+ tree > /tmp/artifacts/tree.log
144
+
145
+ - name : ' Upload Artifact'
146
+ uses : actions/upload-artifact@v4
147
+ with :
148
+ name : everything
149
+ path : /tmp/artifacts/*
150
+ compression-level : 0
0 commit comments