mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(screenshots): run a single component
This commit is contained in:
@@ -7,6 +7,11 @@ inputs:
|
||||
description: 'Playwright total number of test shards (ex: 4)'
|
||||
update:
|
||||
description: 'Whether or not to update the reference snapshots'
|
||||
component:
|
||||
description: 'The component to update the reference snapshots'
|
||||
component-folder:
|
||||
description: 'The component folder to update the reference snapshots'
|
||||
type: boolean
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
@@ -47,7 +52,13 @@ runs:
|
||||
# which is why we not using the upload-archive
|
||||
# composite step here.
|
||||
run: |
|
||||
npm run test.e2e -- --shard=${{ inputs.shard }}/${{ inputs.totalShards }} --update-snapshots
|
||||
FILE_PATH=""
|
||||
if [ -n "${{ inputs.component }}" ] && [ "${{ inputs.component-folder }}" == "true" ]; then
|
||||
FILE_PATH=${{ inputs.component }}
|
||||
elif [ -n "${{ inputs.component }}" ]; then
|
||||
FILE_PATH="src/components/${{ inputs.component }}/"
|
||||
fi
|
||||
npm run test.e2e ${{FILE_PATH}} -- --shard=${{ inputs.shard }}/${{ inputs.totalShards }} --update-snapshots
|
||||
git add src/\*.png --force
|
||||
mkdir updated-screenshots
|
||||
cd ../ && rsync -R --progress $(git diff --name-only --cached) core/updated-screenshots
|
||||
|
||||
12
.github/workflows/update-screenshots.yml
vendored
12
.github/workflows/update-screenshots.yml
vendored
@@ -2,6 +2,16 @@ name: 'Update Reference Screenshots'
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
component:
|
||||
description: 'Which component should be updated? (leave blank to update all)'
|
||||
required: false
|
||||
default: ''
|
||||
component-folder:
|
||||
description: 'If a component is selected, should it only update its respective folder? (leave blank to update all)'
|
||||
required: false
|
||||
default: true
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
build-core:
|
||||
@@ -34,6 +44,8 @@ jobs:
|
||||
shard: ${{ matrix.shard }}
|
||||
totalShards: ${{ matrix.totalShards }}
|
||||
update: true
|
||||
component: ${{ inputs.component}}
|
||||
component-folder: ${{ inputs.component-folder}}
|
||||
|
||||
update-reference-screenshots:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
Reference in New Issue
Block a user