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

64 changes: 64 additions & 0 deletions .github/workflows/build_branch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Build dev and main branches
dagardner-nv marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
branches:
- 'branch-*'
- 'main'

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

permissions:
actions: none
checks: none
contents: read
deployments: none
discussions: none
id-token: write
issues: none
packages: read
pages: none
pull-requests: read
repository-projects: none
security-events: none
statuses: none

jobs:
ci_pipe:
name: CI Pipeline
uses: ./.github/workflows/ci_pipe.yml
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 }}
13 changes: 4 additions & 9 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ on:
push:
branches:
- 'pull-request/**'
- 'branch-*'
- 'main'

# 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 Down Expand Up @@ -61,9 +59,6 @@ jobs:
uses: rapidsai/shared-action-workflows/get-pr-info@branch-23.08
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 +78,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 Down
Loading