Skip to content

Commit f09c404

Browse files
aioyaclaude
andcommitted
chore: add workflow to update test snapshots in CI environment
This workflow can be manually triggered to update snapshots in the Linux environment matching CI (ubuntu-latest with Node 20.19.5). This ensures snapshots match what CI expects, fixing platform-specific snapshot mismatches. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 778ae41 commit f09c404

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Update Snapshots
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: 'Branch to update snapshots on'
8+
required: true
9+
default: 'dev-fix'
10+
11+
jobs:
12+
update-snapshots:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
ref: ${{ github.event.inputs.branch }}
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
21+
- name: Install pnpm
22+
run: npm i -g --force corepack && corepack enable
23+
24+
- name: Set node version to 20
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: '20.19.5'
28+
cache: 'pnpm'
29+
30+
- name: Install dependencies
31+
run: pnpm install --no-frozen-lockfile && node scripts/bootstrap.mjs
32+
33+
- name: Update snapshots
34+
run: |
35+
cd packages/varlet-ui
36+
pnpm exec vitest run --config ../varlet-cli/lib/node/config/vitest.config.js -u src/form/__tests__/index.spec.js src/input/__tests__/index.spec.js
37+
38+
- name: Commit updated snapshots
39+
run: |
40+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
41+
git config --local user.name "github-actions[bot]"
42+
git add -A
43+
git diff --staged --quiet || git commit -m "chore: update test snapshots [skip ci]"
44+
git push

0 commit comments

Comments
 (0)