-
Notifications
You must be signed in to change notification settings - Fork 44
53 lines (51 loc) · 2.06 KB
/
e2e_tests_report.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
name: E2E Tests Report
on:
workflow_run:
workflows: ['E2E Tests']
types:
- completed
jobs:
publish_report:
name: Publish E2E Report
if: >
github.event.workflow_run.event == 'pull_request' &&
(github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure')
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout main
uses: actions/checkout@v2
with:
ref: main
- name: Download Artifacts
uses: dawidd6/action-download-artifact@v6
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
- name: Extract env from workflow
run: |
echo "HTML_REPORT_URL_PATH=$(cat playwright-report/report-link)" >> "$GITHUB_ENV"
echo "REPORT_PR_NUMBER=$(cat playwright-report/report-pr)" >> "$GITHUB_ENV"
- name: Upload HTML Report
timeout-minutes: 3
uses: shallwefootball/s3-upload-action@master
with:
aws_key_id: ${{ secrets.E2E_REPORT_S3_ACCESS_KEY }}
aws_secret_access_key: ${{ secrets.E2E_REPORT_S3_SECRET_KEY}}
aws_bucket: ${{ vars.E2E_REPORT_S3_BUCKET }}
endpoint: ${{ vars.E2E_REPORT_S3_ENDPOINT }}
source_dir: playwright-report/report
destination_dir: ${{ env.HTML_REPORT_URL_PATH }}/report
- name: Output Report URL as Worfklow Annotation
run: |
FULL_HTML_REPORT_URL=https://${{ vars.E2E_REPORT_S3_BUCKET }}.${{ vars.E2E_REPORT_HTML_ENDPOINT }}/${{ env.HTML_REPORT_URL_PATH }}/report
echo "FULL_HTML_REPORT_URL=${FULL_HTML_REPORT_URL}" >> "$GITHUB_ENV"
echo "::notice title=📋 Published Playwright Test Report::$FULL_HTML_REPORT_URL"
- name: Create Comment
uses: marocchino/sticky-pull-request-comment@v2
with:
header: e2e-report
number: ${{ env.REPORT_PR_NUMBER }}
message: '[E2E Report](${{ env.FULL_HTML_REPORT_URL }}) is ready.'