Skip to content
Snippets Groups Projects

feat: add github status report jobs

Merged Wouter Deconinck requested to merge github-status-reporting into master
1 file
+ 48
0
Compare changes
  • Side-by-side
  • Inline
+ 48
0
@@ -22,6 +22,7 @@ default:
@@ -22,6 +22,7 @@ default:
dotenv: juggler.env
dotenv: juggler.env
stages:
stages:
 
- status-pending
- config
- config
- initialize
- initialize
- compile
- compile
@@ -31,6 +32,32 @@ stages:
@@ -31,6 +32,32 @@ stages:
- process
- process
- collect
- collect
- finish
- finish
 
- status-report
 
 
.status:
 
before_script: []
 
script:
 
- |
 
if [ -n "${GITHUB_SHA}" ] ; then
 
curl \
 
-X POST \
 
-H "Accept: application/vnd.github+json" \
 
-H "Authorization: token ${GITHUB_REPO_STATUS_TOKEN}" \
 
"https://api.github.com/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA}" \
 
-d '{"state":"'"${STATE}"'",
 
"target_url":"'"${CI_PIPELINE_URL}"'",
 
"description":"'"${DESCRIPTION}"'",
 
"context":"eicweb/reconstruction_benchmarks"
 
}' ;
 
fi
 
 
benchmarks:reconstruction:pending:
 
stage: status-pending
 
extends: .status
 
variables:
 
STATE: "pending"
 
DESCRIPTION: "The reconstruction benchmarks are running..."
 
when: always
common:setup:
common:setup:
stage: config
stage: config
@@ -95,3 +122,24 @@ final_report:
@@ -95,3 +122,24 @@ final_report:
- echo "It was a success!"
- echo "It was a success!"
allow_failure: true
allow_failure: true
 
benchmarks:reconstruction:success:
 
stage: status-report
 
needs:
 
- ["final_report"]
 
extends: .status
 
variables:
 
STATE: "success"
 
DESCRIPTION: "The reconstruction benchmarks succeeded!"
 
when: on_success
 
 
benchmarks:reconstruction:failure:
 
stage: status-report
 
needs:
 
- ["final_report"]
 
extends: .status
 
variables:
 
STATE: "failure"
 
DESCRIPTION: "The reconstruction benchmarks failed!"
 
when: on_failure
 
 
Loading