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

Create a separate CI workflow for branch-YY.MM & main branches #466

36 changes: 29 additions & 7 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
group: '${{ github.workflow }} @ ${{ github.ref }}'
cancel-in-progress: true

permissions:
Expand All @@ -45,9 +45,11 @@ permissions:
jobs:
pr-builder:
needs:
- build_branch
- checks
- prepare
- ci_pipe
- prepare

secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
prepare:
Expand All @@ -62,8 +64,6 @@ jobs:
if: ${{ startsWith(github.ref_name, 'pull-request/') }}
outputs:
is_pr: ${{ startsWith(github.ref_name, 'pull-request/') }}
is_main_branch: ${{ github.ref_name == 'main' }}
is_dev_branch: ${{ startsWith(github.ref_name, 'branch-') }}
has_conda_build_label: ${{ steps.get-pr-info.outcome == 'success' && contains(fromJSON(steps.get-pr-info.outputs.pr-info).labels.*.name, 'conda-build') || false }}
has_skip_ci_label: ${{ steps.get-pr-info.outcome == 'success' && contains(fromJSON(steps.get-pr-info.outputs.pr-info).labels.*.name, 'skip-ci') || false }}
pr_info: ${{ steps.get-pr-info.outcome == 'success' && steps.get-pr-info.outputs.pr-info || '' }}
Expand All @@ -83,11 +83,11 @@ jobs:
if: ${{ ! fromJSON(needs.prepare.outputs.has_skip_ci_label) }}
with:
# Run checks for any PR branch
run_check: ${{ fromJSON(needs.prepare.outputs.is_pr) }}
run_check: true
# Run conda-build for main/dev branches and PRs with the conda-build label
conda_run_build: ${{ !fromJSON(needs.prepare.outputs.is_pr) || fromJSON(needs.prepare.outputs.has_conda_build_label) }}
conda_run_build: ${{ fromJSON(needs.prepare.outputs.has_conda_build_label) }}
# Update conda package only for non PR branches. Use 'main' for main branch and 'dev' for all other branches
conda_upload_label: ${{ !fromJSON(needs.prepare.outputs.is_pr) && (fromJSON(needs.prepare.outputs.is_main_branch) && 'main' || 'dev') || '' }}
conda_upload_label: false
# Build container
container: nvcr.io/ea-nvidia-morpheus/morpheus:mrc-ci-build-240214
# Test container
Expand All @@ -98,3 +98,25 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CONDA_TOKEN: ${{ secrets.CONDA_TOKEN }}
NGC_API_KEY: ${{ secrets.NGC_API_KEY }}

build_branch:
name: Build Branch
uses: ./.github/workflows/ci_pipe.yml
if: ${{ startsWith(github.ref_name, 'branch-') || github.ref_name == 'main' }}
with:
# Run checks for branch-* but not main
run_check: ${{ startsWith(github.ref_name, 'branch-') }}
# Always perform a conda-build for main/dev branches
conda_run_build: true
# Use 'main' for main branch and 'dev' for all other branches
conda_upload_label: ${{ (github.ref_name == 'main') && 'main' || 'dev' }}
# Build container
container: nvcr.io/ea-nvidia-morpheus/morpheus:mrc-ci-build-240214
# Test container
test_container: nvcr.io/ea-nvidia-morpheus/morpheus:mrc-ci-test-240214
# CI pipe allows for an empty value
pr_info: ''
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CONDA_TOKEN: ${{ secrets.CONDA_TOKEN }}
NGC_API_KEY: ${{ secrets.NGC_API_KEY }}
2 changes: 1 addition & 1 deletion ci/check_style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ rapids-dependency-file-generator \
--file_key checks \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee env.yaml

rapids-mamba-retry env create --force -f env.yaml -n checks
rapids-mamba-retry env create --yes -f env.yaml -n checks
conda activate checks

# Run pre-commit checks
Expand Down
Loading