File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,20 @@ name: Run tests for example apps
22
33on :
44 workflow_dispatch :
5+ inputs :
6+ update-screenshots :
7+ description : " Update screenshots"
8+ required : false
9+ default : " false"
10+
511 # TODO: Enable this when we test this workflow manually
612 # pull_request:
713 # branches:
814 # - develop
915
16+ permissions :
17+ contents : write
18+
1019jobs :
1120 run-tests-example-apps :
1221 runs-on : ubuntu-latest
3039 run : npm install -g http-server
3140
3241 - name : Run tests
33- run : cd examples/tests && npm test
42+ if : inputs.update-screenshots == 'false'
43+ run : cd examples/tests && npm test
44+
45+ - name : Run tests with updated screenshots
46+ if : inputs.update-screenshots == 'true'
47+ run : cd examples/tests && npm test -- --update-snapshots
48+
49+
50+ - name : Upload screenshots
51+ if : inputs.update-screenshots == 'true'
52+ run : |
53+ git config --global user.name "github-actions[bot]"
54+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
55+ git add .
56+ git commit -m 'ci: update screenshots' --allow-empty
57+ git push
You can’t perform that action at this time.
0 commit comments