mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-25 20:40:36 +03:00
56 lines
1.4 KiB
YAML
56 lines
1.4 KiB
YAML
name: Backend CI
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: rsconcept/backend
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
paths:
|
|
- rsconcept/backend/**
|
|
- .github/workflows/backend.yml
|
|
pull_request:
|
|
branches: ["main"]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-22.04
|
|
strategy:
|
|
max-parallel: 4
|
|
matrix:
|
|
python-version: [3.12]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install Dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements-dev-lock.txt
|
|
- name: Lint
|
|
run: |
|
|
pylint project apps
|
|
mypy project apps
|
|
- name: Run Tests
|
|
if: "!cancelled()"
|
|
run: |
|
|
python manage.py check
|
|
python manage.py test
|
|
notify-failure:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
if: failure()
|
|
defaults:
|
|
run:
|
|
working-directory: .
|
|
steps:
|
|
- name: Send Telegram Notification
|
|
run: |
|
|
curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
|
|
-d chat_id=${{ secrets.TELEGRAM_CHAT_ID }} \
|
|
-d text="❌ Backend build failed! Repository: ${{ github.repository }} Commit: ${{ github.sha }}"
|