Skip to content

Commit

Permalink
Adding option to configure running the conda-build CI step with labels (
Browse files Browse the repository at this point in the history
nv-morpheus#349)

This PR is testing the ability to enable/disable CI steps via labels on a PR. Uses the new action `rapidsai/shared-action-workflows/get-pr-info`

New label is `conda-build`.

Authors:
  - Michael Demoret (https://github.com/mdemoret-nv)

Approvers:
  - Christopher Harris (https://github.com/cwharris)

URL: nv-morpheus#349
  • Loading branch information
mdemoret-nv authored Jul 11, 2023
1 parent 5f62b46 commit 782a4f3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/ci_pipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,18 @@ on:
run_package_conda:
required: true
type: boolean
upload_conda_package:
required: true
type: boolean
container:
required: true
type: string
test_container:
required: true
type: string
pr_info:
required: true
type: string
secrets:
CODECOV_TOKEN:
required: true
Expand All @@ -39,6 +45,11 @@ on:
NGC_API_KEY:
required: true

# We only support ubuntu, so bash is the default
defaults:
run:
shell: bash

env:
CHANGE_TARGET: "${{ github.base_ref }}"
GH_TOKEN: "${{ github.token }}"
Expand Down Expand Up @@ -313,4 +324,5 @@ jobs:
shell: bash
env:
CONDA_TOKEN: "${{ secrets.CONDA_TOKEN }}"
run: ./mrc/ci/scripts/github/conda.sh
SCRIPT_ARGS: "${{ inputs.upload_conda_package && 'upload' || '' }}"
run: ./mrc/ci/scripts/github/conda.sh $SCRIPT_ARGS
22 changes: 20 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,31 @@ permissions:
statuses: none

jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
container:
image: rapidsai/ci:latest
steps:
- name: Get PR Info
id: get-pr-info
uses: rapidsai/shared-action-workflows/[email protected]
outputs:
pr_info: ${{ steps.get-pr-info.outputs.pr-info }}
is_pr: ${{ startsWith(github.ref_name, 'pull-request/') }}
is_main_branch: ${{ startsWith(github.ref_name, 'branch-') }}
has_conda_build_label: ${{ contains(fromJSON(steps.get-pr-info.outputs.pr-info).labels.*.name, 'conda-build') }}
ci_pipe:
name: CI Pipeline
needs: [prepare]
uses: ./.github/workflows/ci_pipe.yml
with:
run_check: ${{ startsWith(github.ref_name, 'pull-request/') }}
run_package_conda: ${{ !startsWith(github.ref_name, 'pull-request/') }}
run_check: ${{ fromJSON(needs.prepare.outputs.is_pr) }}
run_package_conda: ${{ fromJSON(needs.prepare.outputs.is_main_branch) || fromJSON(needs.prepare.outputs.has_conda_build_label) }}
upload_conda_package: ${{ fromJSON(needs.prepare.outputs.is_main_branch) }}
container: nvcr.io/ea-nvidia-morpheus/morpheus:mrc-ci-build-230412
test_container: nvcr.io/ea-nvidia-morpheus/morpheus:mrc-ci-test-230412
pr_info: ${{ needs.prepare.outputs.pr_info }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CONDA_TOKEN: ${{ secrets.CONDA_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/github/conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ conda info
rapids-logger "Building Conda Package"

# Run the conda build and upload
${MRC_ROOT}/ci/conda/recipes/run_conda_build.sh upload
${MRC_ROOT}/ci/conda/recipes/run_conda_build.sh "$@"

0 comments on commit 782a4f3

Please sign in to comment.