Skip to content

Commit 05315e4

Browse files
committed
Add blosson ci file
Initial onboarding for Blossom CI/CD infra
1 parent f7b9745 commit 05315e4

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

.github/workflows/blossom-ci.yml

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

0 commit comments

Comments
 (0)