mirror of
https://github.com/wasrusgen/zov-tech.git
synced 2026-06-03 13:24:48 +00:00
ci: UI Playwright smoke после деплоя Pages (workflow_run)
Тригер: Deploy MiniApp to GitHub Pages → completed + success. Скриншот сохраняется как артефакт при провале. workflow_dispatch с опциональным SMOKE_URL для ручного запуска. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f7a1c3e4c0
commit
f397747a34
51
.github/workflows/smoke-ui.yml
vendored
Normal file
51
.github/workflows/smoke-ui.yml
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
name: UI Smoke Tests (Playwright)
|
||||
|
||||
# Запускается автоматически после каждого успешного деплоя GitHub Pages.
|
||||
# Можно запустить вручную: Actions → UI Smoke Tests → Run workflow
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Deploy MiniApp to GitHub Pages"]
|
||||
types: [completed]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
url:
|
||||
description: "URL для тестирования (пусто = https://wasrusgen.github.io/zov-tech/)"
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
jobs:
|
||||
smoke-ui:
|
||||
name: UI Smoke (Playwright)
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# При автозапуске — только если деплой прошёл успешно
|
||||
if: >
|
||||
github.event_name == 'workflow_dispatch' ||
|
||||
github.event.workflow_run.conclusion == 'success'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "20"
|
||||
cache: "npm"
|
||||
|
||||
- name: Установка зависимостей
|
||||
run: npm ci
|
||||
|
||||
- name: Установка Playwright (Chromium)
|
||||
run: npx playwright install chromium --with-deps
|
||||
|
||||
- name: Запуск UI smoke-теста
|
||||
env:
|
||||
SMOKE_URL: ${{ inputs.url || 'https://wasrusgen.github.io/zov-tech/' }}
|
||||
run: node tests/ui_smoke.js
|
||||
|
||||
- name: Загрузить скриншот при провале
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: smoke-screenshot
|
||||
path: tests/ui_last_run.png
|
||||
retention-days: 7
|
||||
Loading…
Reference in New Issue
Block a user