core-api-report on push trunk - 11853533239 #24543
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Report | |
run-name: ${{ inputs.suite }} on ${{ inputs.event }} ${{ inputs.pr_number || inputs.ref_name }} - ${{ inputs.run_id }} | |
on: | |
workflow_dispatch: | |
inputs: | |
run_id: | |
description: 'The run ID of the calling workflow.' | |
required: true | |
default: '' | |
run_attempt: | |
description: 'The run attempt of the calling workflow.' | |
required: false | |
default: '1' | |
artifact: | |
description: 'The name of the artifact to download.' | |
required: true | |
default: '' | |
event: | |
description: 'The event that triggered the tests. E.g. pull_request, daily-checks, release-checks, etc.' | |
required: true | |
default: '' | |
report_title: | |
description: 'The title of the report to generate. It can be the PR title, a commit message or any other identifier.' | |
required: true | |
default: '' | |
pr_number: | |
description: 'The PR number if the report if for a pull request.' | |
required: false | |
default: '' | |
ref_name: | |
description: 'The branch or tag name.' | |
required: false | |
default: '' | |
commit_sha: | |
description: 'The commit SHA.' | |
required: false | |
repository: | |
description: 'The repository name in the format owner/repo.' | |
required: true | |
default: 'woocommerce/woocommerce' | |
suite: | |
description: 'The suite name. E.g. core API, core e2e, blocks e2e, etc.' | |
required: true | |
default: '' | |
env: | |
FORCE_COLOR: 1 | |
jobs: | |
report: | |
name: "Create test report" | |
runs-on: ubuntu-latest | |
env: | |
RUN_ID: ${{ inputs.run_id }} | |
RUN_ATTEMPT: ${{ inputs.run_attempt }} | |
ARTIFACT_NAME: ${{ inputs.artifact }} | |
EVENT_NAME: ${{ inputs.event }} | |
REPORT_TITLE: ${{ inputs.report_title }} | |
PR_NUMBER: ${{ inputs.pr_number }} | |
REF_NAME: ${{ inputs.ref_name }} | |
COMMIT_SHA: ${{ inputs.commit_sha }} | |
REPOSITORY: ${{ inputs.repository }} | |
SUITE_NAME: ${{ inputs.suite }} | |
DOWNLOAD_PATH: downloads | |
REPORT_PATH: downloads/_report | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set report information | |
run: ./bin/set-report-data.sh | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install | |
run: npm i | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: ${{ secrets.AWS_REGION }} | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- name: Wait for artifacts to be available | |
run: ./bin/wait-for-artifacts.sh | |
- name: Download artifacts | |
uses: dawidd6/action-download-artifact@v5 | |
with: | |
repo: ${{ env.REPOSITORY }} | |
run_id: ${{ env.RUN_ID }} | |
path: ${{ env.DOWNLOAD_PATH }} | |
name: ${{ env.ARTIFACT_NAME }} | |
skip_unpack: true | |
- name: Unzip artifacts | |
run: | | |
# Check artifacts | |
ls -la downloads | |
# Unzip artifacts | |
unzip -q downloads/${{ env.ARTIFACT_NAME }}.zip -d downloads | |
# Check artifacts | |
ls -la downloads | |
- name: Install Allure commandline | |
run: npm install -g [email protected] | |
- name: Generate test report | |
env: | |
RESULTS_PATH: ${{ env.DOWNLOAD_PATH }} | |
run: ./bin/generate-report-s3.sh | |
- name: Update dashboard data | |
run: | | |
echo "::group::Update reports list" | |
node ./bin/update-reports-list.js | |
echo "::endgroup::" | |
echo "::group::Update runs list" | |
node ./bin/update-runs-data.js | |
echo "::endgroup::" | |
echo "::group::Update errors list" | |
node ./bin/update-errors-list.js | |
echo "::endgroup::" | |
- name: Update flows list | |
if: ${{ env.EVENT_NAME == 'push' && env.SUITE_NAME == 'core-e2e-report' }} | |
env: | |
RESULTS_PATH: ${{ env.DOWNLOAD_PATH }} | |
run: | | |
echo "::group::Update flows list" | |
node ./bin/generate-flows-list.js | |
echo "::endgroup::" |