Skip to content

Commit

Permalink
test(backstop): updates backstop workflow summary outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrebb committed Oct 11, 2023
1 parent 40745c9 commit f789f36
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/test-backstop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: 🙈 BackstopJS
run-name: "${{ github.ref_name == 'main' && 'PRD' || 'STG' }} - BackstopJS ${{ github.event_name == 'pull_request' && format('PR #{0}: {1} on ', github.event.pull_request.number, github.event.pull_request.title) || format('on latest {0}', github.ref_name) }}"

on:
pull_request:
paths:
- "_ci/backstop/**"
- "!_ci/backstop/bd/bitmaps_reference/**"
branches: [develop]
workflow_call:
secrets:
GH_WORKFLOW_TOKEN:
Expand Down Expand Up @@ -79,28 +74,32 @@ jobs:
REPORT_PATH: ${{ github.ref_name == 'main' && 'prod' || 'stg' }}
run: |
cd _ci/backstop && ENV=$DEPLOY_ENV npm run test.gh
cd _ci/backstop && ENV=$DEPLOY_ENV npm run test.gh
FAIL_TABLE=$(./_utils/parse-report.sh ${{ vars.REPORTS_DOMAIN }} $REPORT_PATH)
echo $FAIL_TABLE >> $GITHUB_ENV
- name: Summarize Failures
if: failure()
if: ${{ failure() }}
env:
REPORT_PATH: ${{ github.ref_name == 'main' && 'prod' || 'stg' }}
run: |
cd _ci/backstop
FAIL_TABLE=$(./_utils/parse-report.sh ${{ vars.REPORTS_DOMAIN }} $REPORT_PATH)
echo "# Backstop Summary" >> $GITHUB_STEP_SUMMARY
echo "## 📋 <a href=\"http://${{ vars.REPORTS_DOMAIN }}/backstop/html_report/gh-$REPORT_PATH/\" target=\"_blank\">View Report</a>" >> $GITHUB_STEP_SUMMARY
echo $FAIL_TABLE >> $GITHUB_STEP_SUMMARY
echo ${{ env.FAIL_TABLE }} >> $GITHUB_STEP_SUMMARY
- name: Summarize Success
if: success()
if: ${{ success() }}
env:
REPORT_PATH: ${{ github.ref_name == 'main' && 'prod' || 'stg' }}
run: |
FAIL_TABLE=$(./_utils/parse-report.sh ${{ vars.REPORTS_DOMAIN }} $REPORT_PATH)
echo "# Backstop Summary" >> $GITHUB_STEP_SUMMARY
echo "## 📋 <a href=\"http://${{ vars.REPORTS_DOMAIN }}/backstop/html_report/gh-$REPORT_PATH/\" target=\"_blank\">View Report</a>" >> $GITHUB_STEP_SUMMARY
echo "## 100% Passing Visual Regresstion!" >> $GITHUB_STEP_SUMMARY
echo "### 🥳 Congratulations!" >> $GITHUB_STEP_SUMMARY
- name: ⬆ Uploading Test Report
id: upload
if: always()
uses: jakejarvis/s3-sync-action@master
with:
Expand All @@ -122,7 +121,7 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

- name: ⬆ Uploading Report
- name: 🛟 Saving Artifact
# if: ${{ steps.backstop.conclusion == 'failure' }}
uses: actions/upload-artifact@v3
with:
Expand Down

0 comments on commit f789f36

Please sign in to comment.