-
Notifications
You must be signed in to change notification settings - Fork 26
122 lines (113 loc) · 4.41 KB
/
pr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# SPDX-FileCopyrightText: Copyright (c) 2022-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 pull request
on:
push:
branches:
- 'pull-request/**'
- '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:
pr-builder:
needs:
- build_branch
- checks
- ci_pipe
- prepare
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
prepare:
name: Prepare
runs-on: ubuntu-latest
container:
image: rapidsai/ci-conda:latest
steps:
- name: Get PR Info
id: get-pr-info
uses: rapidsai/shared-action-workflows/[email protected]
if: ${{ startsWith(github.ref_name, 'pull-request/') }}
outputs:
is_pr: ${{ startsWith(github.ref_name, 'pull-request/') }}
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 || '' }}
checks:
needs: [prepare]
if: ${{ !fromJSON(needs.prepare.outputs.has_skip_ci_label) && fromJSON(needs.prepare.outputs.is_pr )}}
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
enable_check_generated_files: false
ci_pipe:
name: CI Pipeline
needs: [prepare]
uses: ./.github/workflows/ci_pipe.yml
if: ${{ ! fromJSON(needs.prepare.outputs.has_skip_ci_label) }}
with:
# Run checks for any PR branch
run_check: true
# Run conda-build for main/dev branches and PRs with the 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: false
# 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
# Info about the PR. Empty for non PR branches. Useful for extracting PR number, title, etc.
pr_info: ${{ needs.prepare.outputs.pr_info }}
secrets:
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 }}