Skip to content

testing copy 2

testing copy 2 #65

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"