Add annotation for test PR e2e test run results (#48029)
* Add annotation for test results * Minor change to trigger e2e tests * Fix command, add emoji * Update emoji * Add changelog * Update from PR feedback * Revert "Add changelog" This reverts commit03656848eb
. * Revert "Minor change to trigger e2e tests" This reverts commit64e3a87b2d
. --------- Co-authored-by: Jon Lane <jon.lane@automattic.com>
This commit is contained in:
parent
f0feb62837
commit
e8e1391fa0
|
@ -6,13 +6,13 @@ on:
|
|||
- 'trunk'
|
||||
- 'release/*'
|
||||
workflow_call:
|
||||
inputs:
|
||||
trigger:
|
||||
description: 'Type of run to trigger. E.g. daily-e2e, release-checks, etc.'
|
||||
required: true
|
||||
default: 'default'
|
||||
type: string
|
||||
|
||||
inputs:
|
||||
trigger:
|
||||
description: 'Type of run to trigger. E.g. daily-e2e, release-checks, etc.'
|
||||
required: true
|
||||
default: 'default'
|
||||
type: string
|
||||
|
||||
concurrency:
|
||||
group: '${{ github.workflow }}-${{ github.ref }}'
|
||||
cancel-in-progress: true
|
||||
|
@ -55,7 +55,7 @@ jobs:
|
|||
|
||||
let githubEvent = ${{ toJson( github.event_name ) }};
|
||||
let trigger = ${{ toJson( inputs.trigger ) }};
|
||||
|
||||
|
||||
if ( trigger ) {
|
||||
githubEvent = trigger;
|
||||
}
|
||||
|
@ -262,18 +262,18 @@ jobs:
|
|||
'project-default-test-jobs',
|
||||
'project-e2e-test-jobs',
|
||||
'project-api-test-jobs',
|
||||
'project-performance-test-jobs'
|
||||
'project-performance-test-jobs',
|
||||
]
|
||||
if: ${{ always() && github.event_name == 'pull_request' }}
|
||||
steps:
|
||||
- uses: 'actions/checkout@v4'
|
||||
name: 'Checkout'
|
||||
|
||||
|
||||
- name: 'Evaluation'
|
||||
env:
|
||||
REPOSITORY: ${{ github.repository }}
|
||||
RUN_ID: ${{ github.run_id }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
REPOSITORY: ${{ github.repository }}
|
||||
RUN_ID: ${{ github.run_id }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
# Check if project-jobs was successful. Fail for any other status, including skipped.
|
||||
result="${{ needs.project-jobs.result }}"
|
||||
|
@ -281,9 +281,8 @@ jobs:
|
|||
echo "Generating CI jobs was not successful."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
node .github/workflows/scripts/evaluate-jobs-conclusions.js
|
||||
|
||||
node .github/workflows/scripts/evaluate-jobs-conclusions.js
|
||||
|
||||
alert-on-failure:
|
||||
name: 'Report results on Slack'
|
||||
|
@ -295,27 +294,27 @@ jobs:
|
|||
'project-default-test-jobs',
|
||||
'project-e2e-test-jobs',
|
||||
'project-api-test-jobs',
|
||||
'project-performance-test-jobs'
|
||||
'project-performance-test-jobs',
|
||||
]
|
||||
if: ${{ always() && github.event_name != 'pull_request' }}
|
||||
steps:
|
||||
- uses: 'actions/checkout@v4'
|
||||
name: 'Checkout'
|
||||
|
||||
|
||||
- uses: './.github/actions/setup-woocommerce-monorepo'
|
||||
name: 'Setup Monorepo'
|
||||
with:
|
||||
php-version: false
|
||||
|
||||
php-version: false
|
||||
|
||||
- name: 'Send messages for failed jobs'
|
||||
env:
|
||||
SLACK_TOKEN: ${{ secrets.E2E_SLACK_TOKEN }}
|
||||
SLACK_CHANNEL: ${{ secrets.TEST_REPORTS_SLACK_CHANNEL }}
|
||||
HEAD_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
||||
INPUT_TRIGGER: ${{ inputs.trigger }}
|
||||
SLACK_TOKEN: ${{ secrets.E2E_SLACK_TOKEN }}
|
||||
SLACK_CHANNEL: ${{ secrets.TEST_REPORTS_SLACK_CHANNEL }}
|
||||
HEAD_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
||||
INPUT_TRIGGER: ${{ inputs.trigger }}
|
||||
run: |
|
||||
COMMIT_MESSAGE=`echo "$HEAD_COMMIT_MESSAGE" | head -1`
|
||||
|
||||
|
||||
pnpm utils slack-test-report -c "${{ needs.project-jobs.result }}" -r "$INPUT_TRIGGER Build jobs matrix" -m "$COMMIT_MESSAGE"
|
||||
pnpm utils slack-test-report -c "${{ needs.project-lint-jobs.result }}" -r "$INPUT_TRIGGER Linting" -m "$COMMIT_MESSAGE"
|
||||
pnpm utils slack-test-report -c "${{ needs.project-default-test-jobs.result }}" -r "$INPUT_TRIGGER Tests" -m "$COMMIT_MESSAGE"
|
||||
|
@ -382,7 +381,11 @@ jobs:
|
|||
else
|
||||
echo "No report will be created for '$GITHUB_EVENT_NAME' event"
|
||||
fi
|
||||
|
||||
|
||||
- name: 'Add annotation to workflow run linking to PR'
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
run: |
|
||||
echo "::notice::🔗🔗 The e2e report for this run is available at https://woocommerce.github.io/woocommerce-test-reports/pr/${{ github.event.pull_request.number }}/e2e"
|
||||
|
||||
api-test-reports:
|
||||
name: 'Report API tests results'
|
||||
|
|
Loading…
Reference in New Issue