Fix Metrics job (#50482)
This commit is contained in:
parent
418c8f029f
commit
03049e0d17
|
@ -2,20 +2,30 @@
|
||||||
|
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
|
function title() {
|
||||||
|
echo -e "\n\033[1m$1\033[0m"
|
||||||
|
}
|
||||||
|
|
||||||
if [[ -z "$GITHUB_EVENT_NAME" ]]; then
|
if [[ -z "$GITHUB_EVENT_NAME" ]]; then
|
||||||
echo "::error::GITHUB_EVENT_NAME must be set"
|
echo "::error::GITHUB_EVENT_NAME must be set"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Installing dependencies"
|
title "Installing NVM"
|
||||||
pnpm install --filter="compare-perf"
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash > /dev/null
|
||||||
|
export NVM_DIR="$HOME/.nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||||
|
echo "Installed version: $(nvm -v)"
|
||||||
|
|
||||||
|
title "Installing dependencies"
|
||||||
|
pnpm install --frozen-lockfile --filter="compare-perf" > /dev/null
|
||||||
|
|
||||||
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
|
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
|
||||||
echo "Comparing performance with trunk"
|
title "Comparing performance with trunk"
|
||||||
pnpm --filter="compare-perf" run compare perf $GITHUB_SHA trunk --tests-branch $GITHUB_SHA
|
pnpm --filter="compare-perf" run compare perf $GITHUB_SHA trunk --tests-branch $GITHUB_SHA
|
||||||
|
|
||||||
elif [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
|
elif [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
|
||||||
echo "Comparing performance with base branch"
|
title "Comparing performance with base branch"
|
||||||
WP_VERSION=$(awk -F ': ' '/^Tested up to/{print $2}' readme.txt)
|
WP_VERSION=$(awk -F ': ' '/^Tested up to/{print $2}' readme.txt)
|
||||||
# Updating the WP version used for performance jobs means there’s a high
|
# Updating the WP version used for performance jobs means there’s a high
|
||||||
# chance that the reference commit used for performance test stability
|
# chance that the reference commit used for performance test stability
|
||||||
|
@ -32,7 +42,7 @@ elif [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
|
||||||
WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}"
|
WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}"
|
||||||
pnpm --filter="compare-perf" run compare perf $GITHUB_SHA $BASE_SHA --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
|
pnpm --filter="compare-perf" run compare perf $GITHUB_SHA $BASE_SHA --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
|
||||||
|
|
||||||
echo "Publish results to CodeVitals"
|
title "Publish results to CodeVitals"
|
||||||
COMMITTED_AT=$(git show -s $GITHUB_SHA --format="%cI")
|
COMMITTED_AT=$(git show -s $GITHUB_SHA --format="%cI")
|
||||||
pnpm --filter="compare-perf" run log $CODEVITALS_PROJECT_TOKEN trunk $GITHUB_SHA $BASE_SHA $COMMITTED_AT
|
pnpm --filter="compare-perf" run log $CODEVITALS_PROJECT_TOKEN trunk $GITHUB_SHA $BASE_SHA $COMMITTED_AT
|
||||||
else
|
else
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: dev
|
||||||
|
|
||||||
|
Fix the Metrics job by adding a missing NVM install step
|
|
@ -510,7 +510,7 @@
|
||||||
".wp-env.json"
|
".wp-env.json"
|
||||||
],
|
],
|
||||||
"events": [
|
"events": [
|
||||||
"disabled"
|
"push"
|
||||||
],
|
],
|
||||||
"report": {
|
"report": {
|
||||||
"resultsBlobName": "core-metrics-report",
|
"resultsBlobName": "core-metrics-report",
|
||||||
|
|
Loading…
Reference in New Issue