|
1 |
| -# Copyright (c) 2022, NVIDIA CORPORATION. |
| 1 | +# Copyright (c) 2020-2021, NVIDIA CORPORATION. |
2 | 2 | #
|
3 | 3 | # Licensed under the Apache License, Version 2.0 (the "License");
|
4 | 4 | # you may not use this file except in compliance with the License.
|
|
26 | 26 | description: 'argument'
|
27 | 27 | required: false
|
28 | 28 | jobs:
|
29 |
| - Check-Authorization: |
30 |
| - runs-on: ubuntu-latest |
31 |
| - outputs: |
32 |
| - AUTHORIZED: ${{ steps.check-authorization.outputs.authorized }} |
33 |
| - steps: |
34 |
| - - id: check-authorization |
35 |
| - name: Check if commentor is allowed to launch NVIDIA CI |
36 |
| - env: |
37 |
| - AUTHORIZED_USERS: ${{ secrets.AUTHORIZED_USERS }} |
38 |
| - if: | |
39 |
| - contains(${{env.AUTHORIZED_USERS }}, format('{0},', github.actor)) && |
40 |
| - github.event.comment.body == '/nvidia-ci' |
41 |
| - run: echo "::set-output name=authorized=true" |
42 |
| - |
43 |
| - |
44 |
| - Authorize-Blossom: |
45 |
| - name: Authorize NVIDIA CI launch |
46 |
| - runs-on: blossom |
47 |
| - needs: [Check-Authorization] |
| 29 | + Authorization: |
| 30 | + name: Authorization |
| 31 | + runs-on: blossom |
48 | 32 | outputs:
|
49 | 33 | args: ${{ env.args }}
|
50 |
| - |
51 |
| - if: contains('narendasan,', format('{0},', github.actor)) |
52 |
| - |
| 34 | + |
| 35 | + # This job only runs for pull request comments |
| 36 | + if: | |
| 37 | + contains( 'narendasan,', format('{0},', github.actor)) && |
| 38 | + github.event.comment.body == '/blossom-ci' |
53 | 39 | steps:
|
54 |
| - - name: Authorize Blossom launch |
| 40 | + - name: Check if comment is issued by authorized person |
55 | 41 | run: blossom-ci
|
56 | 42 | env:
|
57 | 43 | OPERATION: 'AUTH'
|
58 | 44 | REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
59 | 45 | REPO_KEY_DATA: ${{ secrets.BLOSSOM_KEY }}
|
60 |
| - |
61 | 46 |
|
62 |
| - Vulnerability-Scan: |
| 47 | + Vulnerability-scan: |
63 | 48 | name: Vulnerability scan
|
64 |
| - needs: [Authorize-Blossom] |
| 49 | + needs: [Authorization] |
65 | 50 | runs-on: ubuntu-latest
|
66 | 51 | steps:
|
67 | 52 | - name: Checkout code
|
68 | 53 | uses: actions/checkout@v2
|
69 | 54 | with:
|
70 |
| - repository: ${{ fromJson(needs.Authorize-Blossom.outputs.args).repo }} |
71 |
| - ref: ${{ fromJson(needs.Authorize-Blossom.outputs.args).ref }} |
| 55 | + repository: ${{ fromJson(needs.Authorization.outputs.args).repo }} |
| 56 | + ref: ${{ fromJson(needs.Authorization.outputs.args).ref }} |
72 | 57 | lfs: 'true'
|
73 |
| - |
| 58 | + |
74 | 59 | - name: Run blossom action
|
75 | 60 | uses: NVIDIA/blossom-action@main
|
76 | 61 | env:
|
77 | 62 | REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
78 | 63 | REPO_KEY_DATA: ${{ secrets.BLOSSOM_KEY }}
|
79 | 64 | with:
|
80 |
| - args1: ${{ fromJson(needs.Authorize-Blossom.outputs.args).args1 }} |
81 |
| - args2: ${{ fromJson(needs.Authorize-Blossom.outputs.args).args2 }} |
82 |
| - args3: ${{ fromJson(needs.Authorize-Blossom.outputs.args).args3 }} |
| 65 | + args1: ${{ fromJson(needs.Authorization.outputs.args).args1 }} |
| 66 | + args2: ${{ fromJson(needs.Authorization.outputs.args).args2 }} |
| 67 | + args3: ${{ fromJson(needs.Authorization.outputs.args).args3 }} |
83 | 68 |
|
84 |
| - Launch-NVIDIA-CI: |
85 |
| - name: Start CI job on NVIDIA CI |
86 |
| - needs: [Vulnerability-Scan] |
| 69 | + Job-trigger: |
| 70 | + name: Start ci job |
| 71 | + needs: [Vulnerability-scan] |
87 | 72 | runs-on: blossom
|
88 | 73 | steps:
|
89 |
| - - name: Launch CI |
| 74 | + - name: Start ci job |
90 | 75 | run: blossom-ci
|
91 | 76 | env:
|
92 | 77 | OPERATION: 'START-CI-JOB'
|
|
95 | 80 |
|
96 | 81 | Upload-Log:
|
97 | 82 | name: Upload log
|
98 |
| - needs: [Launch-NVIDIA-CI] |
99 | 83 | runs-on: blossom
|
100 | 84 | if : github.event_name == 'workflow_dispatch'
|
101 | 85 | steps:
|
|
105 | 89 | OPERATION: 'POST-PROCESSING'
|
106 | 90 | CI_SERVER: ${{ secrets.CI_SERVER }}
|
107 | 91 | REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
| 92 | + |
0 commit comments