diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..4db710f1 --- /dev/null +++ b/.github/CODEOWNERS @@ -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 \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cdc68744..d21ab1fc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 @@ -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 @@ -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/