Добавлена страница планировщика #331
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 | |
| on: | |
| push: | |
| branches: [ dev, main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12.10' | |
| - name: Install Poetry | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install poetry | |
| - name: Install dependencies | |
| run: | | |
| poetry config virtualenvs.create false | |
| poetry install --no-interaction --no-ansi --no-root | |
| - name: Lint application | |
| run: | | |
| make lint | |
| tests: | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Set up Docker Compose | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y docker-compose make | |
| - name: Create app/.env and app/.env.postgres | |
| run: | | |
| echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> app/.env.postgres | |
| echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> app/.env.postgres | |
| echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" >> app/.env.postgres | |
| echo "APP_CONFIG__DB__URL=${{ secrets.APP_CONFIG__DB__URL }}" >> app/.env | |
| - name: Build services | |
| run: | | |
| make build | |
| - name: Start containers | |
| run: | | |
| make up | |
| - name: Wait for PostgreSQL to be ready | |
| run: | | |
| POSTGRES_USER=$(grep POSTGRES_USER app/.env.postgres | cut -d '=' -f2) | |
| timeout 20 bash -c " | |
| until docker-compose -f docker/docker-compose.yml exec -T postgres pg_isready -U $POSTGRES_USER; do | |
| echo 'Waiting for PostgreSQL...' | |
| sleep 2 | |
| done | |
| " | |
| - name: Run tests | |
| run: | | |
| make test |