Skip to content
Snippets Groups Projects

fix: rework the status reporting to github

Merged Wouter Deconinck requested to merge wdconinc-master-patch-98887 into master
+ 34
26
@@ -36,26 +36,33 @@ stages:
@@ -36,26 +36,33 @@ stages:
- collect
- collect
- deploy
- deploy
- trigger
- trigger
- status-success
- status-report
benchmarks:detector:pending:
.status:
stage: status-pending
script:
script:
- |
- |
if [ -n "${GITHUB_SHA}" ] ; then
if [ -n "${GITHUB_SHA}" ] ; then
echo https://api.github.com/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA}
curl \
curl \
-X POST \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${GITHUB_REPO_STATUS_TOKEN}" \
-H "Authorization: token ${GITHUB_REPO_STATUS_TOKEN}" \
https://api.github.com/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA} \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA}" \
-d '{"state":"pending", \
-d '{"state":"'"${STATE}"'",
"target_url":"${CI_PIPELINE_URL}", \
"target_url":"'"${CI_PIPELINE_URL}"'",
"description":"The detector benchmarks are running...", \
"description":"'"${DESCRIPTION}"'",
"context":"eicweb/detector_benchmarks" \
"context":"eicweb/detector_benchmarks"
}' ;
}' ;
fi
fi
 
 
benchmarks:detector:pending:
 
stage: status-pending
 
extends: .status
 
variables:
 
STATE: "pending"
 
DESCRIPTION: "The detector benchmarks are running..."
 
when: always
 
common:setup:
common:setup:
stage: config
stage: config
before_script:
before_script:
@@ -153,23 +160,24 @@ deploy_results:
@@ -153,23 +160,24 @@ deploy_results:
- echo "deploy results!"
- echo "deploy results!"
benchmarks:detector:success:
benchmarks:detector:success:
stage: status-success
stage: status-report
needs:
needs:
- ["deploy_results"]
- ["deploy_results"]
script:
extends: .status
- |
variables:
if [ -n "${GITHUB_SHA}" ] ; then
STATE: "success"
curl \
DESCRIPTION: "The detector benchmarks succeeded!"
-X POST \
when: on_success
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${GITHUB_REPO_STATUS_TOKEN}" \
benchmarks:detector:failure:
https://api.github.com/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA} \
stage: status-report
-d '{"state":"success", \
needs:
"target_url":"${CI_PIPELINE_URL}", \
- ["deploy_results"]
"description":"The detector benchmarks succeeded!", \
extends: .status
"context":"eicweb/detector_benchmarks" \
variables:
}' ;
STATE: "failure"
fi
DESCRIPTION: "The detector benchmarks failed!"
 
when: on_failure
benchmarks:reconstruction:
benchmarks:reconstruction:
stage: trigger
stage: trigger
Loading