This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
include comparison URL for weights PRs
- Loading branch information
1 parent
1219981
commit 2d8231c
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
set -Eeu -o pipefail | ||
shopt -s inherit_errexit | ||
|
||
ORG="paritytech" | ||
REPO="$CI_PROJECT_NAME" | ||
|
||
PR_NUMBER="$CI_COMMIT_REF_NAME" | ||
if [[ ! "$PR_NUMBER" =~ ^[[:digit:]]+$ ]]; then | ||
echo "Not a pull request number: $PR_NUMBER" | ||
exit | ||
fi | ||
|
||
BASE_REF="$(curl \ | ||
-sSL \ | ||
-H "Authorization: token $GITHUB_TOKEN" \ | ||
"https://api.github.com/repos/$ORG/$REPO/pulls/$PR_NUMBER" | \ | ||
jq -e -r ".base.ref")" | ||
|
||
WEIGHTS_COMPARISON_URL="$(echo " | ||
https://weights.tasty.limo/compare?repo=$CI_PROJECT_NAME& | ||
threshold=30& | ||
path_pattern=**%2Fweights%2F*.rs& | ||
method=guess-worst& | ||
ignore_errors=true& | ||
unit=time& | ||
old=$BASE_REF& | ||
new=$BRANCHNAME | ||
" | tr -d '\n ')" | ||
|
||
DESCRIPTION="$(echo -n \ | ||
$'\n'$'\n'"Compare the weights with \`$BASE_REF\`: $WEIGHTS_COMPARISON_URL" | \ | ||
jq -sRr @json)" | ||
|
||
# remove the quotes around the JSON-encoded string | ||
echo "${DESCRIPTION:1: -1}" |