Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/actions/artifacts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ outputs:
is_latest:
description: 'true if the pushed tag is the highest version/* tag (release flow only)'
value: ${{ steps.handler.outputs.is_latest }}
version:
description: 'The published snapshot version, e.g. 0.0.0-<branch>-<pr> (PR snapshot only)'
value: ${{ steps.handler.outputs.version }}
packages:
description: 'JSON array of the published package names, [] when nothing was published (PR snapshot only)'
value: ${{ steps.handler.outputs.packages }}
integrities:
description: 'JSON object mapping each published package name to its npm integrity, {} when nothing was published (PR snapshot only)'
value: ${{ steps.handler.outputs.integrities }}
runs:
using: 'composite'
steps:
Expand Down
18 changes: 18 additions & 0 deletions .github/actions/backend-e2e-checkout-commit/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Backend E2E: check out a commit'
description: 'Moves an existing clone to one commit, and fails unless it ends up there'
inputs:
dir:
description: 'The clone, relative to the workspace'
required: true
sha:
description: 'The full commit SHA to check out'
required: true
runs:
using: 'composite'
steps:
- name: Check out the commit
shell: bash
env:
DIR: ${{ inputs.dir }}
SHA: ${{ inputs.sha }}
run: '"$GITHUB_ACTION_PATH/../../../tools/scripts/backend-e2e/checkout-commit.sh" "${DIR}" "${SHA}"'
42 changes: 42 additions & 0 deletions .github/actions/backend-e2e-pin/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: 'Backend E2E: pin snapshot packages'
description: 'Pins the npm snapshot versions a frontend PR published into the npm projects of a backend or cplace-e2e checkout'
inputs:
version:
description: 'The published snapshot version, e.g. 0.0.0-<branch>-<pr>'
required: true
packages:
description: 'JSON array of the published package names'
required: true
dirs:
description: 'Newline-separated globs of npm project dirs, relative to the workspace; a dir without package.json is skipped'
required: true
integrities:
description: 'JSON object mapping each published package name to the npm integrity its snapshot job published; a listed package whose installed integrity differs fails the pin'
required: false
default: '{}'
runs:
using: 'composite'
steps:
- name: Pin snapshot packages
shell: bash
env:
VERSION: ${{ inputs.version }}
PACKAGES: ${{ inputs.packages }}
DIRS: ${{ inputs.dirs }}
INTEGRITIES: ${{ inputs.integrities }}
run: |
set -euo pipefail
mapfile -t patterns <<<"${DIRS}"
pins="$("$GITHUB_ACTION_PATH/../../../tools/scripts/backend-e2e/pin-snapshots.sh" "${VERSION}" "${patterns[@]}")"
echo "${pins}"
{
echo '### Pinned snapshot packages'
echo
if [[ -n "${pins}" ]]; then
echo '```'
echo "${pins}"
echo '```'
else
echo "None of \`${DIRS//$'\n'/ }\` consumes a published package."
fi
} >>"$GITHUB_STEP_SUMMARY"
90 changes: 90 additions & 0 deletions .github/actions/backend-e2e-report/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: 'Backend E2E: build the report'
description: 'Classifies a backend E2E run and writes the PR comment body from the published test results'
inputs:
results_json:
description: 'The json_file of EnricoMi/publish-unit-test-result-action'
required: true
body_file:
description: 'Where to write the comment body'
required: true
results_dir:
description: 'The dir the backend-e2e-results-* artifacts were downloaded to, one subdir per node that uploaded results'
required: true
nodes:
description: 'The number of e2e nodes'
required: true
advisory:
description: 'true when failures are reported as warnings only'
required: true
build_result:
description: 'The build job result'
required: true
e2e_result:
description: 'The e2e matrix result'
required: true
backend_repo:
description: 'The backend repository'
required: true
backend_branch:
description: 'The backend branch'
required: true
backend_sha:
description: 'The backend commit'
required: true
e2e_branch:
description: 'The cplace-e2e branch'
required: true
e2e_sha:
description: 'The cplace-e2e commit'
required: true
snapshot_version:
description: 'The published snapshot version'
required: false
default: ''
backend_packages:
description: 'JSON array of the packages pinned in the backend'
required: true
e2e_packages:
description: 'JSON array of the packages pinned in cplace-e2e'
required: true
outputs:
outcome:
description: 'cancelled, build-failure, test-failure, infrastructure-failure or passed'
value: ${{ steps.report.outputs.outcome }}
message:
description: 'One sentence explaining the outcome'
value: ${{ steps.report.outputs.message }}
tests:
description: 'The number of test results'
value: ${{ steps.report.outputs.tests }}
failed:
description: 'The number of failed and errored tests'
value: ${{ steps.report.outputs.failed }}
runs:
using: 'composite'
steps:
- id: report
shell: bash
env:
RESULTS_JSON: ${{ inputs.results_json }}
BODY_FILE: ${{ inputs.body_file }}
RESULTS_DIR: ${{ inputs.results_dir }}
NODES: ${{ inputs.nodes }}
ADVISORY: ${{ inputs.advisory }}
BUILD_RESULT: ${{ inputs.build_result }}
E2E_RESULT: ${{ inputs.e2e_result }}
BACKEND_REPO: ${{ inputs.backend_repo }}
BACKEND_BRANCH: ${{ inputs.backend_branch }}
BACKEND_SHA: ${{ inputs.backend_sha }}
E2E_BRANCH: ${{ inputs.e2e_branch }}
E2E_SHA: ${{ inputs.e2e_sha }}
SNAPSHOT_VERSION: ${{ inputs.snapshot_version }}
BACKEND_PACKAGES: ${{ inputs.backend_packages }}
E2E_PACKAGES: ${{ inputs.e2e_packages }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
set -euo pipefail
shopt -s nullglob
reported=("${RESULTS_DIR}"/backend-e2e-results-*/)
export NODES_REPORTED="${#reported[@]}"
"$GITHUB_ACTION_PATH/../../../tools/scripts/backend-e2e/build-report.sh" "${RESULTS_JSON}" "${BODY_FILE}"
Loading