Skip to content

Commit 41e1670

Browse files
test: add alignment baselines management in s3
1 parent 8a3ee7a commit 41e1670

2 files changed

Lines changed: 75 additions & 0 deletions

File tree

.github/workflows/ci-baselines.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Generates Playwright visual baseline images in CI and uploads them to S3
2+
#
3+
# This workflow builds the project, runs Playwright to produce fresh baselines,
4+
# and pushes them to S3. Use this when baselines need to be regenerated from
5+
# scratch in a clean CI environment.
6+
#
7+
name: CI Baselines Generate & Upload
8+
9+
on:
10+
workflow_dispatch:
11+
workflow_call:
12+
env:
13+
NPM_AUTH_TOKEN: ${{ secrets.NPM_READONLY_TOKEN }}
14+
CKEDITOR5_LICENSE_KEY: ${{ secrets.CKEDITOR5_LICENSE_KEY }}
15+
16+
jobs:
17+
upload:
18+
name: Generate and upload baselines to S3
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v5
22+
23+
- uses: actions/setup-node@v6
24+
with:
25+
node-version: ${{ vars.NODE_VERSION }}
26+
27+
- name: Install root dependencies
28+
run: npm install
29+
30+
- name: Build
31+
run: npm run build
32+
33+
- name: Install E2E test dependencies
34+
run: |
35+
npm install
36+
npx playwright install --with-deps
37+
working-directory: ./tests
38+
39+
- name: Generate baseline images
40+
run: npx playwright test -g "MTHTML-23 Validate formula alignment" --update-snapshots
41+
working-directory: ./tests
42+
43+
- name: Configure AWS credentials
44+
uses: aws-actions/configure-aws-credentials@v4
45+
with:
46+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_STAGING }}
47+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_STAGING }}
48+
aws-region: eu-west-2
49+
50+
- name: Upload baselines to S3
51+
run: |
52+
aws s3 sync tests/fixtures/ s3://wiris-integrations-staging-html/html/baselines/ci \
53+
--delete \
54+
--exclude "*" \
55+
--include "*.png"
56+
echo "Baselines uploaded successfully"
57+
58+
- name: Generate and upload manifest
59+
run: |
60+
find tests/fixtures/ -name "*.png" -printf "%P\n" | sort > manifest.txt
61+
aws s3 cp manifest.txt s3://wiris-integrations-staging-html/html/baselines/ci/manifest.txt
62+
echo "Manifest uploaded successfully"

.github/workflows/run-e2e-tests.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,19 @@ jobs:
5353
yarn nx build tinymce7
5454
yarn nx build html-tinymce8
5555
56+
- name: Configure AWS credentials
57+
uses: aws-actions/configure-aws-credentials@v4
58+
with:
59+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_STAGING }}
60+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_STAGING }}
61+
aws-region: eu-west-2
62+
63+
- name: Download baseline images from S3
64+
run: |
65+
aws s3 sync s3://wiris-integrations-staging-html/html/baselines/ci/ tests/fixtures/ \
66+
--exclude "*" \
67+
--include "*${{ matrix.editor }}*.png"
68+
5669
- name: Run E2E tests for ${{ matrix.editor }}
5770
id: e2e
5871
run: HTML_EDITOR=${{ matrix.editor }} PLAYWRIGHT_BLOB_OUTPUT_NAME=report-${{ matrix.editor }}.zip yarn test:e2e

0 commit comments

Comments
 (0)