-
Wittenburg, William authored
Added mpi4py to build image and removed unwanted ohpc numpy package. Use github api to retrieve real branch name, use that along with other information to generate a meaningful build name. To keep this from happening too often, we only attempt to retrieve the branch name once for each job during the first step, then communicate that name to subsequent steps via an environment variable. This required that we stop using --login option when running the job steps from circleci, as the lmod environment setup uses the same variable (BASH_ENV) to store the path to the profile setup file that CircleCI sources for each "run" in the job steps. Use github api and the robot user oauth key (from CircleCI env) to post an extra status message on each tested commit pointing to the CDash results. By also adding an "update" step to the default build/test job and using CTEST_UPDATE_VERSION_ONLY=TRUE, we can generate a deep link to the CDash results specific to the appropriate commit.
Wittenburg, William authoredAdded mpi4py to build image and removed unwanted ohpc numpy package. Use github api to retrieve real branch name, use that along with other information to generate a meaningful build name. To keep this from happening too often, we only attempt to retrieve the branch name once for each job during the first step, then communicate that name to subsequent steps via an environment variable. This required that we stop using --login option when running the job steps from circleci, as the lmod environment setup uses the same variable (BASH_ENV) to store the path to the profile setup file that CircleCI sources for each "run" in the job steps. Use github api and the robot user oauth key (from CircleCI env) to post an extra status message on each tested commit pointing to the CDash results. By also adding an "update" step to the default build/test job and using CTEST_UPDATE_VERSION_ONLY=TRUE, we can generate a deep link to the CDash results specific to the appropriate commit.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
postComment.sh 1.44 KiB
#!/usr/bin/bash
PULLREQUESTS=${CIRCLE_PULL_REQUESTS} # comma-separated list of pr urls
REPO=${CIRCLE_PROJECT_REPONAME} # repo name
OWNER=${CIRCLE_PROJECT_USERNAME} # organization or user the repo lives under
TOKEN=${GITHUB_API_KEY} # added to env via CircleCI project settings
COMMIT=${CIRCLE_SHA1} # sha being tested
COMPAREURL=${CIRCLE_COMPARE_URL} # CircleCI provides url for comparing this sha with previous
SHASNIP=$(echo $COMMIT | cut -c1-7) # Grab first 7 characters of the sha to use as link text
CDASHPROJECT="ADIOS"
CDASHURL="https://open.cdash.org/index.php?compare1=61&filtercount=1&field1=revision&project=${CDASHPROJECT}&showfilters=0&limit=100&value1=${COMMIT}&showfeed=0"
COMMENTBODY="View build and test results for change [${SHASNIP}](${COMPAREURL}) on [CDash](${CDASHURL})"
APIBASEURL="https://api.github.com/repos"
get_post_data()
{
cat <<EOF
{
"body": "$COMMENTBODY"
}
EOF
}
postBody="$(get_post_data)"
IFS=',' read -ra ADDR <<< "$PULLREQUESTS"
for i in "${ADDR[@]}"; do
# For each pr url, find the pr number
if [[ "$i" =~ ADIOS2/pull/([[:digit:]]+) ]];
then
prNum=${BASH_REMATCH[1]}
postUrl="${APIBASEURL}/${OWNER}/${REPO}/issues/${prNum}/comments"
curl -u "${OWNER}:${TOKEN}" "${postUrl}" -H "Content-Type: application/json" -H "Accept: application/vnd.github.v3+json" -d "${postBody}"
else
echo "Unable to find PR number in ${i}"
fi
done