lab4: вложения в S3 (MinIO), reconciler PostgreSQL↔S3, тесты и CI

This commit is contained in:
2026-11-04 20:11:33 +03:00
parent ec540a1a72
commit 77b6e5c2c7
86 changed files with 6921 additions and 2 deletions
+94
View File
@@ -0,0 +1,94 @@
# Реальный прогон Docker-стенда lab4 на GitHub-hosted runner.
# Нужен потому, что на машине разработки нет аппаратной виртуализации для Docker Desktop.
# Три независимых стенда параллельно; все результаты — настоящие прогоны.
name: lab4 stand
on:
push:
branches: [lab4]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: lab4-stand-${{ github.ref }}
cancel-in-progress: true
env:
PYTHONUTF8: "1"
jobs:
stand:
name: Стенд — ${{ matrix.part }}
runs-on: ubuntu-24.04
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
part: [base, files, track2]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Unit-тесты Go
if: matrix.part == 'base'
run: |
mkdir -p evidence
go test ./... 2>&1 | tee evidence/go_test.txt
- name: Секреты и запуск стенда
run: |
chmod +x scripts/*.sh infra/s3/init.sh
sh scripts/init-secrets.sh
docker compose --env-file .env config --quiet
docker compose --env-file .env up -d --build --wait
docker compose logs --no-color s3-init
- name: make check + доказательства (${{ matrix.part }})
run: |
make check PYTHON=python
PYTHON=python sh scripts/collect-evidence.sh ${{ matrix.part }}
- name: Окружение runner
if: always()
run: |
mkdir -p evidence
{ nproc; free -m; docker version --format '{{.Server.Version}}'; docker compose version; } > evidence/runner_${{ matrix.part }}.txt
docker compose ps -a > evidence/docker_ps_final_${{ matrix.part }}.txt || true
docker compose logs --no-color s3-init reconciler > evidence/s3init_reconciler_${{ matrix.part }}.log 2>&1 || true
- uses: actions/upload-artifact@v4
if: always()
with:
name: evidence-${{ matrix.part }}
path: evidence/
# api.github.com недоступен из сети разработчика, а github.com (git) — доступен,
# поэтому артефакты публикуются в ветку lab4-results.
publish:
name: Публикация результатов в ветку lab4-results
needs: [stand]
if: always()
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: collected
- name: Commit в lab4-results
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -q --orphan lab4-results
git rm -rf -q .
{ echo "source_commit=${{ github.sha }}"
echo "run=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
echo "stand=${{ needs.stand.result }}"; } > collected/RUN.txt
cp -r collected/. .
rm -rf collected
git add -A
git commit -q -m "results for ${{ github.sha }}"
git push -f origin lab4-results