Skip to content

Commit fb7d9f1

Browse files
authored
Add blossom pre-merge pipeline (21/June) (#2382)
* Add blossom pre-merge pipeline Signed-off-by: Mohammad Adil <[email protected]>
1 parent b653799 commit fb7d9f1

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed

.github/workflows/blossom-ci.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# A workflow to trigger ci on hybrid infra (github + self hosted runner)
2+
name: Blossom-CI
3+
on:
4+
issue_comment:
5+
types: [created]
6+
workflow_dispatch:
7+
inputs:
8+
platform:
9+
description: 'runs-on argument'
10+
required: false
11+
args:
12+
description: 'argument'
13+
required: false
14+
15+
concurrency:
16+
# automatically cancel the previously triggered workflows when there's a newer version
17+
group: build-${{ github.event.pull_request.number || github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
Authorization:
22+
name: Authorization
23+
runs-on: blossom
24+
outputs:
25+
args: ${{ env.args }}
26+
27+
# This job only runs for pull request comments
28+
if: |
29+
contains( 'madil90,Nic-Ma,wyli', format('{0},', github.actor)) &&
30+
github.event.comment.body == '/build'
31+
steps:
32+
- name: Check if comment is issued by authorized person
33+
run: blossom-ci
34+
env:
35+
OPERATION: 'AUTH'
36+
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
REPO_KEY_DATA: ${{ secrets.BLOSSOM_KEY }}
38+
39+
Vulnerability-scan:
40+
name: Vulnerability scan
41+
needs: [Authorization]
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v2
46+
with:
47+
repository: ${{ fromJson(needs.Authorization.outputs.args).repo }}
48+
ref: ${{ fromJson(needs.Authorization.outputs.args).ref }}
49+
lfs: 'true'
50+
51+
# repo specific steps
52+
#- name: Setup java
53+
# uses: actions/setup-java@v1
54+
# with:
55+
# java-version: 1.8
56+
57+
# add blackduck properties https://synopsys.atlassian.net/wiki/spaces/INTDOCS/pages/631308372/Methods+for+Configuring+Analysis#Using-a-configuration-file
58+
#- name: Setup blackduck properties
59+
# run: |
60+
# PROJECTS=$(mvn -am dependency:tree | grep maven-dependency-plugin | awk '{ out="com.nvidia:"$(NF-1);print out }' | grep rapids | xargs | sed -e 's/ /,/g')
61+
# echo detect.maven.build.command="-pl=$PROJECTS -am" >> application.properties
62+
# echo detect.maven.included.scopes=compile >> application.properties
63+
64+
- name: Run blossom action
65+
uses: NVIDIA/blossom-action@main
66+
env:
67+
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
REPO_KEY_DATA: ${{ secrets.BLOSSOM_KEY }}
69+
with:
70+
args1: ${{ fromJson(needs.Authorization.outputs.args).args1 }}
71+
args2: ${{ fromJson(needs.Authorization.outputs.args).args2 }}
72+
args3: ${{ fromJson(needs.Authorization.outputs.args).args3 }}
73+
74+
Job-trigger:
75+
name: Start ci job
76+
needs: [Vulnerability-scan]
77+
runs-on: blossom
78+
steps:
79+
- name: Start ci job
80+
run: blossom-ci
81+
env:
82+
OPERATION: 'START-CI-JOB'
83+
CI_SERVER: ${{ secrets.CI_SERVER }}
84+
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85+
86+
Post-processing:
87+
name: Post processing
88+
runs-on: blossom
89+
if : github.event_name == 'workflow_dispatch'
90+
steps:
91+
- name: Start post processing
92+
run: blossom-ci
93+
env:
94+
OPERATION: 'POST-PROCESSING'
95+
CI_SERVER: ${{ secrets.CI_SERVER }}
96+
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)