-
Notifications
You must be signed in to change notification settings - Fork 8
85 lines (77 loc) · 2.74 KB
/
daily-image-tests.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Daily broken images check
on:
pull_request:
branches:
- main
schedule:
# Every Weekday at 8 AM AEDT - https://cron.help/#0_21_*_*_SUN-THU
- cron: "0 21 * * SUN-THU"
workflow_dispatch:
inputs:
deploy_url:
description: "The URL of the site to test"
required: true
tests_to_run:
description: "The tests to run"
required: true
create_issue:
description: "Create an issue if there are broken images"
type: boolean
default: true
defaults:
run:
shell: pwsh
env:
create_issue: ${{ github.event.inputs.create_issue || true }}
jobs:
check-broken-images:
name: Run Playwright Tests
uses: ./.github/workflows/template-ui-tests.yml
with:
deploy_url: ${{ inputs.deploy_url || 'https://ssw.com.au' }}
tests_to_run: ${{ inputs.tests_to_run || 'images'}}
test-output:
name: Test Output
runs-on: ubuntu-latest
needs: check-broken-images
outputs:
create_issue: ${{ steps.results.outputs.create_issue }}
steps:
- name: Playwright Artifact
id: results
shell: pwsh
run: |
echo "Test passed : ${{ needs.check-broken-images.outputs.testPassed }}"
echo "Artifact Id: ${{ needs.check-broken-images.outputs.artifact-id }}"
echo "Create Issue: ${{ env.create_issue }}"
echo "Test Pass condition: ${{ needs.check-broken-images.outputs.testPassed == 'false'}}"
echo "Condition: ${{ env.create_issue && needs.check-broken-images.outputs.testPassed == 'false'}}"
echo $create_issue=${{ env.create_issue }}
echo "create_issue=$create_issue" >> $GITHUB_OUTPUT
create-an-issue:
name: GitHub Issue
runs-on: ubuntu-latest
needs:
- check-broken-images
- test-output
if: ${{ needs.check-broken-images.outputs.testPassed == 'false'}}
steps:
- name: Playwright Artifact
run: |
echo "Artifact Id: ${{ needs.check-broken-images.outputs.artifact-id }}"
- name: Create an Issue
if: ${{ needs.check-broken-images.outputs.testPassed == 'false'}}
uses: JasonEtco/create-an-issue@v2
- name: show the value
run: |
echo " value from the above :${{ needs.test-output.outputs.create_issue }}"
echo " condition :${{ needs.test-output.outputs.create_issue == true }}"
# - name: Create an Issue
# uses: JasonEtco/create-an-issue@v2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TITLE: "Broken Images on Homepage"
# ARTIFACT_ID: ${{ needs.check-broken-images.outputs.artifact-id }}
# GITHUB_RUN_ID: ${{ github.run_id }}
# with:
# filename: .github/ISSUE_TEMPLATE/auto_bug_report.md