Merge pull request 'CI/CD' (#2) from develop into production

Reviewed-on: http://85.208.253.135:3000/sajad-dev/Ai/pulls/2
This commit is contained in:
2026-03-19 23:20:42 +00:00
+13 -38
View File
@@ -18,15 +18,7 @@ jobs:
name: Lint & Test
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ['3.11']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Ubuntu apt mirrors
run: |
sudo tee /etc/apt/sources.list > /dev/null <<'EOF'
@@ -36,43 +28,26 @@ jobs:
EOF
sudo apt-get update
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install Python
run: |
sudo apt-get install -y python3 python3-pip python3-venv git
- name: Setup Python pip mirrors
run: |
pip 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
pip config --user set global.trusted-host "package-mirror.liara.ir mirror.cdn.ir mirror2.chabokan.net"
pip3 config --user set global.index-url https://package-mirror.liara.ir/repository/pypi/simple
pip3 config --user set global.extra-index-url https://mirror.cdn.ir/repository/pypi/simple
pip3 config --user set global.trusted-host "package-mirror.liara.ir mirror.cdn.ir mirror2.chabokan.net"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest flake8
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
pip3 install pytest flake8
- 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
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
run: |
pytest -q