refactor: разбить goals.py (1430 строк) на пакет #87
This file contains hidden or 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: CI/CD | |
| "on": | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.14" | |
| cache: pip | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt -r requirements-dev.txt | |
| - name: Lint (ruff) | |
| run: ruff check . | |
| - name: Cache mypy | |
| uses: actions/cache@v5 | |
| with: | |
| path: .mypy_cache | |
| key: mypy-${{ runner.os }}-py3.14-${{ hashFiles('requirements*.txt') }} | |
| restore-keys: | | |
| mypy-${{ runner.os }}-py3.14- | |
| - name: Type check (mypy) | |
| run: mypy core/ | |
| - name: Run tests | |
| env: | |
| BOT_TOKEN: "0000000000:test_token_for_ci" | |
| run: python -m pytest tests/ -v | |
| deploy: | |
| needs: test | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to server | |
| uses: appleboy/ssh-action@v1 | |
| env: | |
| BOT_TOKEN: ${{ secrets.BOT_TOKEN }} | |
| ADMIN_ID: ${{ secrets.ADMIN_ID }} | |
| DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USER }} | |
| password: ${{ secrets.SSH_PASSWORD }} | |
| envs: BOT_TOKEN,ADMIN_ID,DATABASE_URL | |
| script: | | |
| cd /var/www/financebot | |
| git pull origin main | |
| printf "BOT_TOKEN=%s\nADMIN_ID=%s\nDATABASE_URL=%s\n" \ | |
| "$BOT_TOKEN" "$ADMIN_ID" "$DATABASE_URL" > .env | |
| venv/bin/pip install -r requirements.txt -q | |
| systemctl restart financebot | |
| systemctl is-active financebot |