-
-
Notifications
You must be signed in to change notification settings - Fork 681
43 lines (43 loc) · 1.82 KB
/
show_screenshot_test_results.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# This is a separate workflow so that it can access secrets, which are necessary
# because we need to be able to upload the images and post a comment.
# In the event this workflow fails, the screenshot test results are still
# available as an artifact of the screenshot test comparison workflow itself.
# This simply provides necessary quality of life.
name: Show Screenshot Test Results
on:
workflow_run:
workflows: [CI Suite]
types:
- completed
jobs:
show_screenshot_test_results:
if: ( !contains(github.event.head_commit.message, '[ci skip]') && github.event.workflow_run.run_attempt == 1 )
name: Show Screenshot Test Results
runs-on: ubuntu-22.04
steps:
- name: "Check for ARTIFACTS_FILE_HOUSE_KEY"
id: secrets_set
env:
ENABLER_SECRET: ${{ secrets.ARTIFACTS_FILE_HOUSE_KEY }}
run: |
unset SECRET_EXISTS
if [ -n "$ENABLER_SECRET" ]; then SECRET_EXISTS=true ; fi
echo "SECRETS_ENABLED=$SECRET_EXISTS" >> $GITHUB_OUTPUT
- name: Checkout
if: steps.secrets_set.outputs.SECRETS_ENABLED
uses: actions/checkout@v4
- name: Prepare module
if: steps.secrets_set.outputs.SECRETS_ENABLED
run: |
# This is needed because node-fetch needs import and doesn't work with require :/
echo "{\"type\": \"module\"}" > package.json
npm install node-fetch
- name: Show screenshot test results
if: steps.secrets_set.outputs.SECRETS_ENABLED
uses: actions/github-script@v6
env:
FILE_HOUSE_KEY: ${{ secrets.ARTIFACTS_FILE_HOUSE_KEY }}
with:
script: |
const { showScreenshotTestResults } = await import('${{ github.workspace }}/tools/ci/show_screenshot_test_results.js')
await showScreenshotTestResults({ github, context, exec })