bug fix #174
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Install tools needed | |
run: | | |
curl -k --disable --disable-eprt -s https://tea-cup.midori-ai.xyz/download/standard-linux-midori-ai-updater > updater | |
sudo chmod +x updater | |
sudo mv updater /usr/local/bin/midori_ai_updater | |
sudo midori_ai_updater | |
- name: Moved Needed Files | |
run: | | |
mv -t ./ Subsystem-Manager/subsystem-manager-uv/* | |
- name: Upload Files | |
run: | | |
sudo midori_ai_login --commandline --username "${{ secrets.MIDORI_AI_USERNAME }}" --bypassplatform "${{ secrets.MIDORI_AI_PASSWORD }}" --bypassoscheck "${{ secrets.MIDORI_AI_TFA }}" | |
sudo midori_ai_uploader --type Windows --file "version.py" --filename "version.py" | |
sudo midori_ai_uploader --type Windows --file "edit_models.py" --filename "edit_models.py" | |
sudo midori_ai_uploader --type Windows --file "setup_models.py" --filename "setup_models.py" | |
sudo midori_ai_uploader --type Windows --file "setup_docker.py" --filename "setup_docker.py" | |
sudo midori_ai_uploader --type Windows --file "subsystem_manager.py" --filename "model_installer.py" | |
sudo midori_ai_uploader --type Windows --file "carly_help.py" --filename "carly_help.py" | |
sudo midori_ai_uploader --type Windows --file "support.py" --filename "support.py" | |
sudo midori_ai_uploader --type Windows --file "requirements.txt" --filename "midori_program_requirments.txt" |