Skip to content

Commit

Permalink
Update CI message (#220)
Browse files Browse the repository at this point in the history
* include CODEOWNERS

* include status messages

* include status messages

* improve message

* improve message

* improve message

* improve message

* improve message
  • Loading branch information
jeanbez committed Jan 13, 2025
1 parent 83bde6a commit 0a1e146
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 9 deletions.
13 changes: 13 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This is a comment.
# Each line is a file pattern followed by one or more owners.

# For more info about this file, please see
# https://docs.github.com/en/enterprise/2.18/user/github/creating-cloning-and-archiving-repositories/about-code-owners

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,

* @hpc-io/pdc-developers

# This directory controls the permissions/review requirements
.github/ @hpc-io/pdc
37 changes: 28 additions & 9 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
variables:
STATUS_PROJECT: "hpc-io/pdc"
STATUS_NAME: "NERSC / Perlmutter"
PDC_BUILD_PATH: "${CI_PROJECT_DIR}/build"
PDC_INSTALL_PATH: "${CI_PROJECT_DIR}/install"
GIT_CLONE_PATH: "${CI_BUILDS_DIR}/${CI_PROJECT_NAME}/${CI_JOB_ID}"

stages:
- authorize
- build
- test
- metrics

.report-status:
variables:
STATUS_PROJECT: "hpc-io/pdc"
STATUS_NAME: "NERSC / Perlmutter"
script:
# For complete details on the GitHub API please see:
# https://developer.github.com/v3/repos/statuses
Expand All @@ -22,30 +22,50 @@ stages:
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${STATUS_PROJECT}/statuses/${CI_COMMIT_SHA}" \
-d "{\"state\":\"${CI_JOB_NAME}\",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${STATUS_NAME}\"}"
-d "{\"state\":\"${CI_JOB_NAME}\",\"description\":\"${STATUS_MESSAGE}\",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${STATUS_NAME}\"}"
pending:
stage: .pre
variables:
STATUS_MESSAGE: "Waiting for manual approval..."
extends:
- .report-status

success:
stage: .post
variables:
STATUS_MESSAGE: "Successfully passed all tests on NERSC system!"
extends:
- .report-status

failure:
stage: .post
variables:
STATUS_MESSAGE: "Failed to pass all tests on NERSC system!"
extends:
- .report-status
rules:
- when: on_failure

perlmutter-no-cache-build:
stage: build
perlmutter-authorize:
stage: authorize
rules:
- if: '$METRICS == null'
when: manual
script:
- |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${STATUS_PROJECT}/statuses/${CI_COMMIT_SHA}" \
-d "{\"state\":\"pending\",\"description\":\"Running...\",\"target_url\":\"${CI_PIPELINE_URL}\",\"context\":\"${STATUS_NAME}\"}"
perlmutter-no-cache-build:
stage: build
needs:
- perlmutter-authorize
id_tokens:
SITE_ID_TOKEN:
aud: https://gitlab.com
Expand All @@ -71,9 +91,8 @@ perlmutter-no-cache-build:

perlmutter-cache-build:
stage: build
rules:
- if: '$METRICS == null'
when: manual
needs:
- perlmutter-authorize
id_tokens:
SITE_ID_TOKEN:
aud: https://gitlab.com/
Expand Down

0 comments on commit 0a1e146

Please sign in to comment.