-
Notifications
You must be signed in to change notification settings - Fork 7
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
ab46df1
commit a8fa8b9
Showing
22 changed files
with
330 additions
and
165 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
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 |
---|---|---|
@@ -1,40 +1,75 @@ | ||
name: Update Snapshots on a PR | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pr_number: | ||
description: "Pull Request Number" | ||
required: true | ||
type: string | ||
workflow_dispatch: | ||
inputs: | ||
pr_number: | ||
description: 'Pull Request Number (Warning: This action will push a commit to the referenced PR)' | ||
required: true | ||
type: string | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: write | ||
pull-requests: write | ||
contents: write | ||
|
||
jobs: | ||
update-pr: | ||
name: Update PR Snapshots | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout PR | ||
if: github.event_name == 'workflow_dispatch' | ||
run: gh pr checkout ${{ github.event.inputs.pr_number }} | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run command | ||
if: github.event_name == 'workflow_dispatch' | ||
run: | | ||
echo "Running A command here command..." | ||
# Step 5: Commit and push changes back to the PR branch | ||
# - name: Commit and push changes | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# run: | | ||
# git config user.name "github-actions[bot]" | ||
# git config user.email "github-actions[bot]@users.noreply.github.com" | ||
# git add . | ||
# git commit -m "Automated updates from GitHub Actions" | ||
# git push origin ${{ env.PR_BRANCH }} | ||
update-pr: | ||
name: Update PR Snapshots | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout PR ${{ github.event.inputs.pr_number }} | ||
if: github.event_name == 'workflow_dispatch' | ||
run: gh pr checkout ${{ github.event.inputs.pr_number }} | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Use Node.js from .nvmrc | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
|
||
- name: Cache node modules | ||
id: cache-npm | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Build all | ||
run: npm run build && npm run build.debug | ||
|
||
- name: Fetch fonts | ||
run: npm run fetch-fonts | ||
|
||
- name: Install Playwright Browsers | ||
run: npx playwright install --with-deps | ||
|
||
- name: Run Screenshot tests | ||
id: screenshot_tests | ||
run: npm run test.int -- screenshots.js --grep @screenshots | ||
|
||
- if: ${{ failure() && steps.screenshot_tests.conclusion == 'success' }} | ||
run: | | ||
echo "nothing to update - tests all passed" | ||
- name: Re-Running Playwright to update snapshots | ||
id: screenshot_tests_update | ||
if: ${{ failure() && steps.screenshot_tests.conclusion == 'failure' }} | ||
run: npm run test.int -- screenshots.js --grep @screenshots --update-snapshots --last-failed | ||
|
||
- name: Commit the updated files to the PR branch | ||
if: ${{ failure() && steps.screenshot_tests_update.conclusion == 'success' }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config user.name "github-actions[bot]" | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
git add integration-tests/* | ||
git commit -m "Updated snapshots via workflow" | ||
git push origin HEAD |
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 |
---|---|---|
|
@@ -19,3 +19,4 @@ build/ | |
build/app_backup | ||
bslive.yml | ||
.vscode | ||
/json-reports |
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
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.