Files
ant-design/.github/workflows/visual-regression-diff-build.yml
blacksmith-sh[bot] 38efd012a2 .github/workflows: Migrate workflows to Blacksmith runners (#56282)
* Migrate workflows to Blacksmith

* Update .github/workflows/preview-build.yml

Signed-off-by: thinkasany <480968828@qq.com>

* preview-build.yml use runs-on: ubuntu-latest (#56367)

* Initial plan

* fix: add named exports for ColorPalettes and ColorPaletteToolDark to fix SSR compatibility

Co-authored-by: thinkasany <117748716+thinkasany@users.noreply.github.com>

* test: preview-build use ubuntu-latest

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: thinkasany <117748716+thinkasany@users.noreply.github.com>
Co-authored-by: thinkasany <480968828@qq.com>

---------

Signed-off-by: thinkasany <480968828@qq.com>
Co-authored-by: blacksmith-sh[bot] <157653362+blacksmith-sh[bot]@users.noreply.github.com>
Co-authored-by: afc163 <afc163@gmail.com>
Co-authored-by: thinkasany <480968828@qq.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: thinkasany <117748716+thinkasany@users.noreply.github.com>
2025-12-30 23:04:15 +08:00

92 lines
2.7 KiB
YAML

# Each PR will visual-regression diff that help to check code is work as expect.
name: 👀 Visual Regression Diff Build
on:
pull_request:
branches: [master, feature, next]
types: [opened, synchronize, reopened]
# Cancel prev CI if new commit come
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
############################ Generate Snapshot ###########################
visual-diff-snapshot:
name: visual-diff snapshot
strategy:
matrix:
shard: [1/2, 2/2]
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v6
- uses: utooland/setup-utoo@v1
- run: ut
- name: generate image snapshots
id: test-image
run: |
node node_modules/puppeteer/install.mjs
ut version
ut test:image -- --shard=${{matrix.shard}}
env:
NODE_OPTIONS: --max_old_space_size=4096
- uses: actions/upload-artifact@v4
name: artifact snapshot
with:
name: snapshot-artifacts-${{ strategy.job-index }}
path: imageSnapshots/
retention-days: 2
############################### Diff Images ##############################
visual-diff-report:
name: visual-diff report
runs-on: blacksmith-4vcpu-ubuntu-2404
needs: visual-diff-snapshot
steps:
- uses: actions/checkout@v6
- uses: utooland/setup-utoo@v1
- run: ut
- uses: actions/download-artifact@v7
with:
pattern: snapshot-artifacts-*
merge-multiple: true
path: imageSnapshots/
# Execute visual regression diff task and zip then
# output as visualRegressionReport.tar.gz
- name: visual regression diff
env:
EVENT_NUMBER: ${{ github.event.number }}
BASE_REF: ${{ github.base_ref }}
run: |
ut test:visual-regression -- --pr-id=$EVENT_NUMBER --base-ref=$BASE_REF --max-workers=2
# Upload report in `visualRegressionReport`
- name: upload report artifact
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: visual-regression-report
path: visualRegressionReport.tar.gz
# Upload git ref for next workflow `visual-regression-diff-finish` use
- name: Save persist key
if: ${{ always() }}
# should be pr id
run: echo ${{ github.event.number }} > ./visual-regression-pr-id.txt
- name: Upload persist key
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: visual-regression-diff-ref
path: ./visual-regression-pr-id.txt