28 Commits

Author SHA1 Message Date
ca14dfe982 Обновить .github/workflows/notify.yaml 2025-07-29 07:29:23 +00:00
d15475c5f3 Обновить .github/workflows/build.yaml 2025-07-29 07:29:04 +00:00
011e818f6c Обновить .github/workflows/all_test4.yaml 2025-07-29 07:05:54 +00:00
9463d122df Обновить .github/workflows/all_test4.yaml 2025-07-28 06:25:31 +00:00
66b4e757d2 Обновить .github/workflows/all_test4.yaml 2025-07-27 21:04:57 +00:00
e7167566c0 Обновить .github/workflows/all_test4.yaml 2025-07-27 20:43:22 +00:00
3f6984fb44 Обновить .github/workflows/all_test4.yaml 2025-07-27 20:10:11 +00:00
9fb1595e63 Обновить .github/workflows/all_test4.yaml 2025-07-27 20:07:54 +00:00
8f9e4c43db Обновить .github/workflows/all_test4.yaml 2025-07-27 19:37:59 +00:00
680b85de00 Обновить .github/workflows/all_test4.yaml 2025-07-27 19:31:56 +00:00
bc1d9adca2 Обновить .github/workflows/all_test4.yaml 2025-07-27 19:28:18 +00:00
917a737b52 Обновить .github/workflows/all_test4.yaml 2025-07-27 18:21:07 +00:00
be496ca2ba Обновить .github/workflows/all_test4.yaml 2025-07-27 18:11:55 +00:00
d79013e589 Обновить .github/workflows/all_test4.yaml 2025-07-25 15:02:31 +00:00
01bac40296 Обновить .github/workflows/all_test4.yaml 2025-07-25 14:57:21 +00:00
d71efd5f56 Обновить .github/workflows/all_test4.yaml 2025-07-25 14:52:03 +00:00
f734bfb104 Обновить .github/workflows/all_test4.yaml 2025-07-25 14:32:25 +00:00
e2ca8c4257 Обновить .github/workflows/all_test4.yaml 2025-07-25 14:22:34 +00:00
3759d788c3 Обновить .github/workflows/all_test4.yaml 2025-07-25 14:18:00 +00:00
3bbcb51347 Обновить .github/workflows/all_test4.yaml 2025-07-25 14:15:01 +00:00
57379c0a84 Обновить .github/workflows/all_test4.yaml 2025-07-25 13:56:59 +00:00
3d7bbfb4fc Добавить .github/workflows/ all_test4.yaml 2025-07-25 13:08:27 +00:00
eadec8eaef Обновить .github/workflows/all_test3.yaml 2025-05-27 09:33:47 +00:00
1d4fbabb56 Обновить .github/workflows/all_test3.yaml 2025-05-23 15:40:41 +00:00
63bb5a9bb0 Обновить .github/workflows/all_test3.yaml 2025-05-23 15:35:09 +00:00
a818870163 Обновить .github/workflows/all_test3.yaml 2025-05-23 15:34:38 +00:00
8c427e63bc Добавить .github/workflows/all_test3.yaml 2025-05-23 12:08:26 +00:00
c210985324 Добавить .github/workflows/all_test2.yaml 2025-05-13 09:00:04 +00:00
5 changed files with 439 additions and 2 deletions

101
.github/workflows/all_test2.yaml vendored Normal file
View File

@@ -0,0 +1,101 @@
on:
workflow_call:
inputs:
tag:
description: 'Tag for registry'
type: string
default: latest
force_build:
type: boolean
description: force_build
default: false
jobs:
tests:
runs-on: gpu
env:
effective_tag: ${{ inputs.tag || github.head_ref || github.ref_name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Login to Yandex Cloud
uses: yc-actions/yc-cr-login@v2
with:
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
- name: Send PRBot feedback
uses: imgurbot12/prbot@v2
with:
username: ${{ secrets.ACCOUNT_NAME }}
api_token: ${{ secrets.GITHUBTOKEN }}
- name: Prepare prbot_data directory
run: mkdir -p /home/runner/prbot_data && chmod -R 777 /home/runner/prbot_data
- name: Ruff format check (strict)
run: |
echo "Starting Ruff format check with tag: ${{ env.effective_tag }}"
docker run --rm \
-v /home/runner/prbot_data:/tmp \
cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.effective_tag }} \
bash -c '
pip install ruff
cd /server
echo "=== Ruff format check ==="
ruff format . --check
' \
| tee /home/runner/prbot_data/full_output.txt | prbot
echo "=== Format Output ==="
cat /home/runner/prbot_data/full_output.txt
- name: Run Docker with output redirection
run: |
docker run --rm \
-v /home/runner/prbot_data:/tmp \
cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.effective_tag }} \
bash -c '
pip install ruff pytest pytest-github-actions-annotate-failures
echo "=== Ruff ==="
cd /server && ruff check . | sed "s|/server/||g" || true
' \
| tee /home/runner/prbot_data/full_output.txt | prbot
echo "=== Full Output ==="
cat /home/runner/prbot_data/full_output.txt
- name: Pytest individual files + PRBot formatting
run: |
docker run --rm \
-v /home/runner/prbot_data:/tmp \
cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.effective_tag }} \
bash -c '
pip install pytest pytest-github-actions-annotate-failures
cd /server
echo "=== Running Pytest Files Individually ==="
find . -name "test_*.py" | sort | while read -r test_file; do
echo "Starting Pytest for file: $test_file"
pytest -v -W always "$test_file" --capture=no --annotate-failures 2>&1 | tee -a /tmp/test_output.txt
echo "" >> /tmp/test_output.txt
done
echo "=== Formatting Output for PRBot ==="
> /tmp/prbot_output.txt
' \
| tee /home/runner/prbot_data/full_output.txt | prbot
echo " === Pytest raw output ==="
cat /home/runner/prbot_data/full_output.txt || echo "::warning::full_output.txt not found!"
- name: Commit PRBot feedback
if: always()
run: |
prbot commit

168
.github/workflows/all_test3.yaml vendored Normal file
View File

@@ -0,0 +1,168 @@
on:
workflow_call:
inputs:
tag:
description: 'Tag for registry'
type: string
default: latest
force_build:
type: boolean
description: force_build
default: false
jobs:
tests:
runs-on: gpu
env:
effective_tag: ${{ inputs.tag || github.head_ref || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Extract Postgres container env vars from Compose
run: |
POSTGRES_CONTAINER=$(awk '/postgres/{f=1} f && /container_name:/ {print $2; exit}' docker-compose-dev.yaml)
POSTGRES_USER=$(awk '/postgres/{f=1} f && /POSTGRES_USER:/ {print $2; exit}' docker-compose-dev.yaml)
POSTGRES_DB=$(awk '/postgres/{f=1} f && /POSTGRES_DB:/ {print $2; exit}' docker-compose-dev.yaml)
echo "Found container: $POSTGRES_CONTAINER"
echo "DB: $POSTGRES_DB, USER: $POSTGRES_USER"
echo "POSTGRES_CONTAINER=$POSTGRES_CONTAINER" >> $GITHUB_ENV
echo "POSTGRES_USER=$POSTGRES_USER" >> $GITHUB_ENV
echo "POSTGRES_DB=$POSTGRES_DB" >> $GITHUB_ENV
- name: Login to Yandex Cloud
uses: yc-actions/yc-cr-login@v2
with:
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
- name: Send PRBot feedback
uses: imgurbot12/prbot@v2
with:
username: ${{ secrets.ACCOUNT_NAME }}
api_token: ${{ secrets.GITHUBTOKEN }}
- name: Prepare prbot_data directory
run: mkdir -p /home/runner/prbot_data && chmod -R 777 /home/runner/prbot_data
- name: Sanitize tag
run: |
TAG="${{ inputs.tag || github.head_ref || github.ref_name }}"
SANITIZED_TAG=$(echo "$TAG" | tr '/' '-')
echo "SANITIZED_TAG=$SANITIZED_TAG" >> $GITHUB_ENV
- name: Pull Docker image explicitly
run: |
docker pull cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.SANITIZED_TAG }}
- name: Setup SSH access to Gitea
run: |
mkdir -p ~/.ssh
echo "${{ secrets.GITEASSH }}" | base64 -d > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H bb.hublab.ru >> ~/.ssh/known_hosts
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV
#На случай зависших сервисов
- name: Clean up existing Docker Compose services (if any)
run: |
docker compose -f docker-compose-dev.yaml down || true
- name: Start docker-compose services
env:
DOCKER_BUILDKIT: 1
SSH_AUTH_SOCK: ${{ env.SSH_AUTH_SOCK }}
run: |
docker compose -f docker-compose-dev.yaml up -d
- name: Ruff format check (strict)
run: |
echo "Starting Ruff format check with tag: ${{ env.SANITIZED_TAG }}"
docker run --rm \
-v /home/runner/prbot_data:/tmp \
cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.SANITIZED_TAG }} \
bash -c '
pip install ruff
cd /server
echo "=== Ruff format check ==="
ruff format . --check
' \
| tee /home/runner/prbot_data/full_output.txt | prbot
echo "=== Format Output ==="
cat /home/runner/prbot_data/full_output.txt
- name: Run Docker with output redirection
run: |
docker run --rm \
-v /home/runner/prbot_data:/tmp \
cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.SANITIZED_TAG }} \
bash -c '
pip install ruff pytest pytest-github-actions-annotate-failures
echo "=== Ruff ==="
cd /server && ruff check . | sed "s|/server/||g" || true
' \
| tee /home/runner/prbot_data/full_output.txt | prbot
echo "=== Full Output ==="
cat /home/runner/prbot_data/full_output.txt
- name: Create database
run: |
docker exec "$POSTGRES_CONTAINER" bash -c 'psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "DROP DATABASE IF EXISTS test"'
docker exec "$POSTGRES_CONTAINER" bash -c 'psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "CREATE DATABASE test"'
- name: Pytest inside other container via docker exec from main test container
run: |
docker run --rm \
--network hub-network \
-v /home/runner/prbot_data:/tmp \
-e GITEASSH="$(echo "${{ secrets.GITEASSH }}" | tr -d '\n')" \
cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.SANITIZED_TAG }} \
bash -c '
mkdir -p ~/.ssh
echo "$GITEASSH" | base64 -d > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H bb.hublab.ru >> ~/.ssh/known_hosts
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
echo "🔧 Copying test config"
cp config-tests-example.yaml config.yaml
cp config-tests-example.yaml config-tests.yaml
echo "🚀 Creating virtual environment..."
python3 -m venv .venv && \
source .venv/bin/activate && \
echo "✅ Virtual environment activated."
echo "📦 Installing requirements from requirements-dev.txt"
pip install --upgrade pip && \
pip install -r /server/requirements-dev.txt && \
pip install pytest
pip install pytest-github-actions-annotate-failures
echo "🔍 Searching for test files and running them individually"
pytest -v -W always --capture=no \
2>&1 | tee /tmp/test_output.txt
echo "📄 Copying results to PRBot output"
cat /tmp/test_output.txt > /tmp/prbot_output.txt
'
- name: Commit PRBot feedback
if: always()
run: |
prbot commit
- name: Stop docker-compose services
if: always()
run: |
docker compose -f docker-compose-dev.yaml down
- name: Cleanup SSH key
if: always()
run: |
rm -f ~/.ssh/id_rsa ~/.ssh/id_rsa.pub

168
.github/workflows/all_test4.yaml vendored Normal file
View File

@@ -0,0 +1,168 @@
on:
workflow_call:
inputs:
tag:
description: 'Tag for registry'
type: string
default: latest
force_build:
type: boolean
description: force_build
default: false
jobs:
tests:
runs-on: ubuntu-22.04-v25.04.01
env:
effective_tag: ${{ inputs.tag || github.head_ref || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Extract Postgres container env vars from Compose
run: |
POSTGRES_CONTAINER=$(awk '/postgres/{f=1} f && /container_name:/ {print $2; exit}' docker-compose-dev.yaml)
POSTGRES_USER=$(awk '/postgres/{f=1} f && /POSTGRES_USER:/ {print $2; exit}' docker-compose-dev.yaml)
POSTGRES_DB=$(awk '/postgres/{f=1} f && /POSTGRES_DB:/ {print $2; exit}' docker-compose-dev.yaml)
echo "Found container: $POSTGRES_CONTAINER"
echo "DB: $POSTGRES_DB, USER: $POSTGRES_USER"
echo "POSTGRES_CONTAINER=$POSTGRES_CONTAINER" >> $GITHUB_ENV
echo "POSTGRES_USER=$POSTGRES_USER" >> $GITHUB_ENV
echo "POSTGRES_DB=$POSTGRES_DB" >> $GITHUB_ENV
- name: Login to Yandex Cloud
uses: yc-actions/yc-cr-login@v2
with:
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
- name: Send PRBot feedback
uses: imgurbot12/prbot@v2
with:
username: ${{ secrets.ACCOUNT_NAME }}
api_token: ${{ secrets.GITHUBTOKEN }}
- name: Prepare prbot_data directory
run: mkdir -p /home/runner/prbot_data && chmod -R 777 /home/runner/prbot_data
- name: Sanitize tag
run: |
TAG="${{ inputs.tag || github.head_ref || github.ref_name }}"
SANITIZED_TAG=$(echo "$TAG" | tr '/' '-')
echo "SANITIZED_TAG=$SANITIZED_TAG" >> $GITHUB_ENV
- name: Pull Docker image explicitly
run: |
docker pull cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.SANITIZED_TAG }}
- name: Setup SSH access to Gitea
run: |
mkdir -p ~/.ssh
echo "${{ secrets.GITEASSH }}" | base64 -d > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H bb.hublab.ru >> ~/.ssh/known_hosts
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV
#На случай зависших сервисов
- name: Clean up existing Docker Compose services (if any)
run: |
docker compose -f docker-compose-dev.yaml down || true
- name: Start docker-compose services
env:
DOCKER_BUILDKIT: 1
SSH_AUTH_SOCK: ${{ env.SSH_AUTH_SOCK }}
run: |
docker compose -f docker-compose-dev.yaml up -d
- name: Ruff format check (strict)
run: |
echo "Starting Ruff format check with tag: ${{ env.SANITIZED_TAG }}"
docker run --rm \
-v /home/runner/prbot_data:/tmp \
cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.SANITIZED_TAG }} \
bash -c '
pip install ruff
cd /server
echo "=== Ruff format check ==="
ruff format . --check
' \
| tee /home/runner/prbot_data/full_output.txt | prbot
echo "=== Format Output ==="
cat /home/runner/prbot_data/full_output.txt
- name: Run Docker with output redirection
run: |
docker run --rm \
-v /home/runner/prbot_data:/tmp \
cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.SANITIZED_TAG }} \
bash -c '
pip install ruff pytest pytest-github-actions-annotate-failures
echo "=== Ruff ==="
cd /server && ruff check . | sed "s|/server/||g" || true
' \
| tee /home/runner/prbot_data/full_output.txt | prbot
echo "=== Full Output ==="
cat /home/runner/prbot_data/full_output.txt
- name: Create database
run: |
docker exec "$POSTGRES_CONTAINER" bash -c 'psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "DROP DATABASE IF EXISTS test"'
docker exec "$POSTGRES_CONTAINER" bash -c 'psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "CREATE DATABASE test"'
- name: Pytest inside other container via docker exec from main test container
run: |
docker run --rm \
--network hub-network \
-v /home/runner/prbot_data:/tmp \
-e GITEASSH="$(echo "${{ secrets.GITEASSH }}" | tr -d '\n')" \
cr.yandex/crp8vh46gd976oq8ipla/${{ github.event.repository.name }}:${{ env.SANITIZED_TAG }} \
bash -c '
mkdir -p ~/.ssh
echo "$GITEASSH" | base64 -d > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H bb.hublab.ru >> ~/.ssh/known_hosts
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
echo "🔧 Copying test config"
cp config-tests-example.yaml config.yaml
cp config-tests-example.yaml config-tests.yaml
echo "🚀 Creating virtual environment..."
python3 -m venv .venv && \
source .venv/bin/activate && \
echo "✅ Virtual environment activated."
echo "📦 Installing requirements from requirements-dev.txt"
pip install --upgrade pip && \
pip install -r /server/requirements-dev.txt && \
pip install pytest
pip install pytest-github-actions-annotate-failures
echo "🔍 Searching for test files and running them individually"
pytest -v -W always --capture=no \
2>&1 | tee /tmp/test_output.txt
echo "📄 Copying results to PRBot output"
cat /tmp/test_output.txt > /tmp/prbot_output.txt
'
- name: Commit PRBot feedback
if: always()
run: |
prbot commit
- name: Stop docker-compose services
if: always()
run: |
docker compose -f docker-compose-dev.yaml down
- name: Cleanup SSH key
if: always()
run: |
rm -f ~/.ssh/id_rsa ~/.ssh/id_rsa.pub

View File

@@ -15,7 +15,7 @@ on:
jobs: jobs:
build: build:
runs-on: gpu runs-on: ubuntu-22.04-v25.04.01
env: env:
CR_REGISTRY: crp8vh46gd976oq8ipla CR_REGISTRY: crp8vh46gd976oq8ipla
CR_REPO: ${{ github.event.repository.name }} CR_REPO: ${{ github.event.repository.name }}

View File

@@ -13,7 +13,7 @@ on:
default: build default: build
jobs: jobs:
notify: notify:
runs-on: gpu runs-on: ubuntu-22.04-v25.04.01
steps: steps:
- uses: mattermost/action-mattermost-notify@master - uses: mattermost/action-mattermost-notify@master
with: with: