Repository navigation
82 lines (70 loc) · 2.96 KB
/
Copy pathvrt-baselines.yml
File metadata and controls
82 lines (70 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: VRT baselines (manual)
# Manually-triggered helper that regenerates the Linux Playwright VRT
# baselines for `@steerable/agent-ui` on the same `ubuntu-22.04` runner the
# `Storybook quality` workflow uses for enforcement, then uploads the
# resulting `*-chromium-desktop-linux.png` files as a single artifact.
#
# Why this exists alongside `scripts/generate-vrt-baselines-linux.sh`:
# * The shell script needs Docker locally and a reliable pull of the
# ~1.5GB `mcr.microsoft.com/playwright` image — historically flaky from
# some networks. This workflow side-steps the local Docker dependency
# entirely and uses *exactly* the OS image the gating job runs on,
# eliminating cross-runner drift as a class of bug.
# * It is `workflow_dispatch` only so it never runs on its own and adds
# no recurring CI cost.
#
# Workflow:
# 1. Trigger from the Actions UI, or via `gh workflow run vrt-baselines.yml`.
# 2. Wait for the run to finish (~90s on `ubuntu-22.04`).
# 3. Download the `vrt-baselines-linux` artifact:
# gh run download <run-id> -n vrt-baselines-linux \
# -D packages/agent-ui/ts/tests/visual/stories.spec.ts-snapshots
# 4. Commit the refreshed `*-chromium-desktop-linux.png` files alongside
# the source change that motivated the refresh.
on:
workflow_dispatch:
inputs:
reason:
description: "Why are you regenerating baselines? (free text)"
required: false
default: "intentional UI change requires baseline refresh"
permissions:
contents: read
jobs:
generate:
name: regenerate baselines on ubuntu-22.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v5
with:
node-version: 26
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Install Playwright browsers (chromium only)
run: pnpm --filter @steerable/agent-ui exec playwright install --with-deps chromium
- name: Build Storybook
env:
STORYBOOK_DISABLE_TELEMETRY: "1"
CI: "1"
run: pnpm --filter @steerable/agent-ui storybook:build
- name: Generate snapshots
working-directory: packages/agent-ui/ts
# `vrt:update` always writes the screenshots out — it never fails on
# a missing baseline.
run: pnpm storybook:vrt:update
- name: Show what was produced
working-directory: packages/agent-ui/ts/tests/visual/stories.spec.ts-snapshots
run: |
echo "Generated baselines:"
ls -1 *-chromium-desktop-linux.png | sort
echo
echo "Total: $(ls *-chromium-desktop-linux.png | wc -l)"
- name: Upload baselines artifact
uses: actions/upload-artifact@v5
with:
name: vrt-baselines-linux
path: packages/agent-ui/ts/tests/visual/stories.spec.ts-snapshots/*-chromium-desktop-linux.png
if-no-files-found: error
retention-days: 14