-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f0730c2
commit a80b01b
Showing
106 changed files
with
50,983 additions
and
64,373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
name: Update snapshots with manual approval | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
jobs: | ||
update-snapshots: | ||
name: Update Snapshots | ||
if: github.event.issue.pull_request && contains(github.event.comment.body, '/approve-snapshots') | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
package: [react-components] | ||
|
||
steps: | ||
- name: Get branch of PR | ||
uses: xt0rted/pull-request-comment-branch@v2 | ||
id: comment-branch | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ steps.comment-branch.outputs.head_ref }} | ||
fetch-depth: 2 | ||
lfs: 'true' | ||
|
||
- name: Comment action started | ||
uses: thollander/actions-comment-pull-request@v3 | ||
with: | ||
message: | | ||
### Updating snapshots. Click [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) to see the status. | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
cache-dependency-path: '**/package-lock.json' | ||
|
||
- name: node_modules cache | ||
id: npm-cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-node_modules-${{hashFiles('**/package-lock.json')}} | ||
restore-keys: | | ||
${{ runner.os }}-node_modules- | ||
- name: Install | ||
if: steps.npm-cache.outputs.cache-hit != 'true' | ||
shell: bash | ||
env: | ||
NODE_OPTIONS: '--max_old_space_size=8192' | ||
run: npm ci --prefer-offline --no-audit --progress=false --workspaces --include-workspace-root | ||
|
||
- name: Turbo cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: '.turbo' | ||
key: ${{ runner.os }}-turbo-playwright-${{ matrix.package}}-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-turbo-pla`ywright-${{ matrix.package}}- | ||
- name: Get installed Playwright version | ||
id: playwright-version | ||
run: echo "::set-output name=version::$(npm info @playwright/test version)" | ||
|
||
- name: Playwright cache | ||
uses: actions/cache@v4 | ||
id: playwright-cache | ||
with: | ||
path: | | ||
~/.cache/ms-playwright | ||
key: '${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}' | ||
restore-keys: | | ||
${{ runner.os }}-playwright- | ||
- name: Install Playwright with dependencies | ||
if: steps.playwright-cache.outputs.cache-hit != 'true' | ||
run: npx playwright install --with-deps | ||
|
||
- name: Install Playwright's dependencies | ||
if: steps.playwright-cache.outputs.cache-hit == 'true' | ||
run: npx playwright install-deps | ||
|
||
- name: Run Playwright update snapshots | ||
run: npx turbo test:ui:update --filter=@iot-app-kit/${{matrix.package}} | ||
|
||
- name: Commit and push updated snapshots | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: 'Chore: update @iot-app-kit/${{matrix.package}} snapshots' | ||
|
||
- name: Comment success | ||
uses: thollander/actions-comment-pull-request@v3 | ||
with: | ||
message: | | ||
### 🎉 Successfully updated and committed Playwright snapshots! 🎉 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.