Files
EventHubFrontAdmin/.gitea/workflows/e2e-ift.yml
T
aleksey e577c02eb3
CI / test (push) Successful in 2m47s
CI / push-image (push) Successful in 6m56s
CI / ci-done (push) Successful in 0s
fix(ci): обход падения playwright --with-deps на WSL runner.
На act_runner apt падает на half-configured openssh-server без systemd;
fallback устанавливает только Chromium, если системные libs уже есть.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 10:24:06 +03:00

82 lines
3.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: E2E IFT smoke (admin)
# После успешного Deploy IFT — smoke против живого IFT (без API-моков).
# Учётки берутся с хоста IFT из /opt/eventhub-ift/.env
# (SMOKE_ADMIN_* → fallback ADMIN_SUPER_*; см. EventHubDevOps/ift/.env.example).
# Опц. secret E2E_IFT_BASE_URL (default https://admin-ui.ift.eventhub.local).
on:
workflow_run:
workflows: ["Deploy IFT (admin)"]
types: [completed]
workflow_dispatch:
concurrency:
group: eventhub-frontadmin-e2e-ift
cancel-in-progress: false
jobs:
ift-smoke:
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.sha }}
- uses: actions/setup-node@v4
with:
node-version: '22'
- run: npm ci
- name: Install Playwright browser
run: bash scripts/install-playwright-chromium.sh
- name: Load smoke credentials from IFT .env
env:
SSH_HOST: ${{ secrets.IFT_SSH_HOST }}
SSH_USER: ${{ secrets.IFT_SSH_USER }}
SSH_KEY: ${{ secrets.IFT_SSH_PRIVATE_KEY }}
run: |
set -euo pipefail
KEY=$(mktemp)
printf '%s\n' "$SSH_KEY" > "$KEY"
chmod 600 "$KEY"
# Источник истины — env на стенде (не отдельные Gitea E2E secrets).
REMOTE=$(ssh -i "$KEY" -o BatchMode=yes -o StrictHostKeyChecking=accept-new \
"${SSH_USER}@${SSH_HOST}" \
"grep -E '^(SMOKE_ADMIN_EMAIL|SMOKE_ADMIN_PASSWORD|ADMIN_SUPER_EMAIL|ADMIN_SUPER_PASSWORD)=' /opt/eventhub-ift/.env || true")
rm -f "$KEY"
EMAIL=$(printf '%s\n' "$REMOTE" | sed -n 's/^SMOKE_ADMIN_EMAIL=//p' | head -1)
PASS=$(printf '%s\n' "$REMOTE" | sed -n 's/^SMOKE_ADMIN_PASSWORD=//p' | head -1)
if [ -z "$EMAIL" ]; then
EMAIL=$(printf '%s\n' "$REMOTE" | sed -n 's/^ADMIN_SUPER_EMAIL=//p' | head -1)
fi
if [ -z "$PASS" ]; then
PASS=$(printf '%s\n' "$REMOTE" | sed -n 's/^ADMIN_SUPER_PASSWORD=//p' | head -1)
fi
if [ -z "$EMAIL" ] || [ -z "$PASS" ]; then
echo "::error::В /opt/eventhub-ift/.env нет SMOKE_ADMIN_* / ADMIN_SUPER_*"
exit 1
fi
echo "SMOKE_ADMIN_EMAIL=${EMAIL}" >> "$GITHUB_ENV"
echo "SMOKE_ADMIN_PASSWORD=${PASS}" >> "$GITHUB_ENV"
echo "Loaded smoke admin email: ${EMAIL}"
- name: IFT smoke
env:
E2E_TARGET: ift
E2E_IFT_BASE_URL: ${{ secrets.E2E_IFT_BASE_URL }}
run: npm run test:e2e:ift
- name: Upload Playwright report
if: failure()
uses: actions/upload-artifact@v3
with:
name: playwright-ift-report
path: playwright-report/
retention-days: 7