Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally skip ci based on a label in the pr #1444

Merged
merged 17 commits into from
Dec 20, 2023
Prev Previous commit
Next Next commit
log and exit early
  • Loading branch information
dagardner-nv committed Dec 19, 2023
commit 1cab896eda09b6992b74469bcc04fcb518139081
12 changes: 12 additions & 0 deletions .github/workflows/ci_pipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ on:
test_container:
required: true
type: string
pr_info:
required: true
type: string
pr_outcome:
required: true
type: boolean
has_skip_ci_label:
required: true
type: boolean

secrets:
NGC_API_KEY:
required: true
Expand All @@ -40,6 +50,8 @@ env:
MORPHEUS_ROOT: "${{ github.workspace }}/morpheus"
WORKSPACE: "${{ github.workspace }}/morpheus"
WORKSPACE_TMP: "${{ github.workspace }}/tmp"
PR_OUTCOME: "${{ github.event.inputs.pr_outcome }}"
HAS_SKIP_CI_LABEL: "${{ github.event.inputs.has_skip_ci_label }}"

permissions:
actions: none
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
uses: rapidsai/shared-action-workflows/get-pr-info@branch-23.08
if: ${{ startsWith(github.ref_name, 'pull-request/') }}
outputs:
pr_output: ${{ steps.get-pr-info.outcome == 'success' }}
pr_outcome: ${{ steps.get-pr-info.outcome == 'success' }}
pr_info: ${{ steps.get-pr-info.outputs.pr-info }}
has_skip_ci_label: ${{ steps.get-pr-info.outcome == 'success' && contains(fromJSON(steps.get-pr-info.outputs.pr-info).labels.*.name, 'skip-ci') || false }}

Expand All @@ -62,6 +62,10 @@ jobs:
needs: [prepare]
uses: ./.github/workflows/ci_pipe.yml
with:
pr_info: ${{ needs.prepare.outputs.pr_info }}
pr_outcome: ${{ needs.prepare.outputs.pr_outcome }}
has_skip_ci_label: ${{ needs.prepare.outputs.has_skip_ci_label }}

run_check: ${{ startsWith(github.ref_name, 'pull-request/') }}
container: nvcr.io/ea-nvidia-morpheus/morpheus:morpheus-ci-build-230913
test_container: nvcr.io/ea-nvidia-morpheus/morpheus:morpheus-ci-test-230913
Expand Down
4 changes: 4 additions & 0 deletions ci/scripts/github/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

set -e

rapids-logger "PR_OUTCOME=${PR_OUTCOME}"
rapids-logger "HAS_SKIP_CI_LABEL=${HAS_SKIP_CI_LABEL}"
exit 1

source ${WORKSPACE}/ci/scripts/github/common.sh

update_conda_env
Expand Down