Skip to content

test

test #4647

name: E2E Tests Report
on:
workflow_run:
workflows: ['E2E Tests']
types:
- completed
push:
branches:
# only for test
- CHARTS-10864-remove-gh-pages-branch
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"
run: |
echo "HTML_REPORT_URL_PATH=reports/CHARTS-10864-remove-gh-pages-branch" >> "$GITHUB_ENV"
echo "REPORT_PR_NUMBER=1988" >> "$GITHUB_ENV"
- name: Move report to commit folder
run: |
mkdir -p ${{ env.HTML_REPORT_URL_PATH }}/report && echo test > ${{ env.HTML_REPORT_URL_PATH }}/report/test
- 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=${{ vars.E2E_REPORT_S3_ENDPOINT }}/${{ vars.E2E_REPORT_S3_BUCKET }}/${{ 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.'