diff --git a/.github/workflows/ci_pipe.yml b/.github/workflows/ci_pipe.yml index e233d3718..f7da1c83e 100644 --- a/.github/workflows/ci_pipe.yml +++ b/.github/workflows/ci_pipe.yml @@ -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 @@ -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 }}" @@ -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 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 1a6cfd061..37a9d33e0 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -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/get-pr-info@branch-23.08 + 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 }} diff --git a/ci/scripts/github/conda.sh b/ci/scripts/github/conda.sh index d9854de8f..3b8104ad3 100755 --- a/ci/scripts/github/conda.sh +++ b/ci/scripts/github/conda.sh @@ -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 "$@"