Skip to content
Snippets Groups Projects
Commit ff5152d1 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

fix: rework the status reporting to github

parent aeeeb80c
No related branches found
No related tags found
1 merge request!122fix: rework the status reporting to github
...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment