This commit is contained in:
2026-03-20 02:50:00 +03:30
parent 7f20611617
commit 0cf1bfcd45
+13 -38
View File
@@ -18,15 +18,7 @@ jobs:
name: Lint & Test name: Lint & Test
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ['3.11']
steps: steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Ubuntu apt mirrors - name: Setup Ubuntu apt mirrors
run: | run: |
sudo tee /etc/apt/sources.list > /dev/null <<'EOF' sudo tee /etc/apt/sources.list > /dev/null <<'EOF'
@@ -36,43 +28,26 @@ jobs:
EOF EOF
sudo apt-get update sudo apt-get update
- name: Set up Python - name: Install Python
uses: actions/setup-python@v5 run: |
with: sudo apt-get install -y python3 python3-pip python3-venv git
python-version: 3.11
- name: Setup Python pip mirrors - name: Setup Python pip mirrors
run: | run: |
pip config --user set global.index-url https://package-mirror.liara.ir/repository/pypi/simple pip3 config --user set global.index-url https://package-mirror.liara.ir/repository/pypi/simple
pip config --user set global.extra-index-url https://mirror.cdn.ir/repository/pypi/simple pip3 config --user set global.extra-index-url https://mirror.cdn.ir/repository/pypi/simple
pip config --user set global.trusted-host "package-mirror.liara.ir mirror.cdn.ir mirror2.chabokan.net" pip3 config --user set global.trusted-host "package-mirror.liara.ir mirror.cdn.ir mirror2.chabokan.net"
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python3 -m pip install --upgrade pip
pip install -r requirements.txt pip3 install -r requirements.txt
pip install pytest flake8 pip3 install pytest flake8
- name: Run lint - name: Run lint
run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Run tests - name: Run tests
run: pytest -q run: |
pytest -q
# deploy:
# name: Deploy AI Service
# needs: test
# if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/production'
# runs-on: ubuntu-latest
# steps:
# - name: Deploy via SSH
# uses: appleboy/ssh-action@v1
# with:
# host: ${{ secrets.SSH_HOST }}
# username: ${{ secrets.SSH_USER }}
# port: ${{ secrets.SSH_PORT }}
# key: ${{ secrets.SSH_PRIVATE_KEY }}
# script: |
# git pull origin production
# docker compose up -d --build