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