|
9 | 9 | pull_request: |
10 | 10 | types: [opened, synchronize, reopened] |
11 | 11 |
|
| 12 | + on: |
| 13 | + workflow_call: |
| 14 | + inputs: |
| 15 | + perform-build: |
| 16 | + required: false |
| 17 | + type: boolean |
| 18 | + build-profile: |
| 19 | + required: false |
| 20 | + type: string |
| 21 | + language: |
| 22 | + required: false |
| 23 | + type: string |
| 24 | + report-unit-test-coverage: |
| 25 | + required: false |
| 26 | + type: boolean |
| 27 | + report-to-atlassian-dashboard: |
| 28 | + required: false |
| 29 | + type: boolean |
| 30 | + quality-product-name: |
| 31 | + required: false |
| 32 | + type: string |
| 33 | + quality-sonar-app-name: |
| 34 | + required: false |
| 35 | + type: string |
| 36 | + quality-testing-type: |
| 37 | + required: false |
| 38 | + type: string |
| 39 | + quality-service-name: |
| 40 | + required: false |
| 41 | + type: string |
| 42 | + quality-junit-report: |
| 43 | + required: false |
| 44 | + type: string |
| 45 | + visibility: |
| 46 | + required: false |
| 47 | + type: string |
| 48 | + udf1: |
| 49 | + required: false |
| 50 | + type: string |
| 51 | + udf2: |
| 52 | + required: false |
| 53 | + type: string |
| 54 | + udf3: |
| 55 | + required: false |
| 56 | + type: string |
| 57 | + |
| 58 | + |
12 | 59 | jobs: |
| 60 | + echo-inputs: |
| 61 | + name: 'Echo inputs' |
| 62 | + runs-on: ubuntu-latest |
| 63 | + steps: |
| 64 | + - name: Echo inputs |
| 65 | + run: | |
| 66 | + echo "Sonarqube scan for PRIVATE repositories, running on ubuntu-latest-4-cores runner" |
| 67 | + echo "Perform build set to ${{ inputs.perform-build }}" |
| 68 | + echo "Build profile set to ${{ inputs.build-profile }}" |
| 69 | + echo "Language set to ${{ inputs.language }} " |
| 70 | + echo "Visibility set to ${{ inputs.visibility }} [ ${{ github.event.repository.visibility }} ]" |
| 71 | + echo "Perform unit test coverage set to ${{ inputs.report-unit-test-coverage }}" |
| 72 | + echo "Report to Atlassian dashboard set to ${{ inputs.report-to-atlassian-dashboard }}" |
| 73 | + echo "Quality product name set to ${{ inputs.quality-product-name }}" |
| 74 | + echo "Quality sonar application name set to ${{ inputs.quality-sonar-app-name }}" |
| 75 | + echo "Quality testing type set to ${{ inputs.quality-testing-type }}" |
| 76 | + echo "Quality service name set to ${{ inputs.quality-service-name }}" |
| 77 | + echo "Quality JUnit report set to ${{ inputs.quality-junit-report }}" |
| 78 | + echo "Go private modules set to ${{ inputs.go-private-modules }}" |
| 79 | + |
13 | 80 | SonarQube: |
14 | 81 | runs-on: ubuntu-latest |
15 | 82 | permissions: |
@@ -39,25 +106,30 @@ jobs: |
39 | 106 | echo "##[warning]Waiting for 30 seconds to allow the firewall rule to take effect" |
40 | 107 | sleep 30 |
41 | 108 |
|
42 | | - - name: Install native deps for protobuf & ZeroMQ |
43 | | - run: | |
44 | | - sudo apt-get update |
45 | | - sudo apt-get install -y protobuf-compiler pkg-config libzmq3-dev |
46 | | -
|
47 | | - - name: Install cargo-tarpaulin |
48 | | - run: cargo install cargo-tarpaulin |
49 | | - |
50 | | - - name: Run coverage with Tarpaulin |
51 | | - run: | |
52 | | - # produce an lcov report under ./coverage/ |
53 | | - cargo tarpaulin --out Lcov --output-dir coverage |
54 | | -
|
55 | 109 | - name: SonarQube Scan |
| 110 | + if: ${{ inputs.visibility == 'public' }} |
56 | 111 | uses: sonarsource/sonarqube-scan-action@v5.1.0 |
57 | 112 | continue-on-error: true |
58 | 113 | env: |
59 | 114 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
60 | 115 | SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} |
| 116 | + |
| 117 | + - name: Run SonarQube report generation |
| 118 | + if: ${{ inputs.report-to-atlassian-dashboard == true }} |
| 119 | + uses: Progress-I360/github-action-reporting/sonarqube@main |
| 120 | + with: |
| 121 | + PRODUCT_NAME: ${{ inputs.quality-product-name }} |
| 122 | + SONAR_APP_NAME: ${{ inputs.quality-sonar-app-name }} |
| 123 | + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
| 124 | + |
| 125 | + - name: Run report generation |
| 126 | + if: ${{ inputs.report-to-atlassian-dashboard == true && inputs.report-unit-test-coverage == true }} |
| 127 | + uses: Progress-I360/github-action-reporting/automation@main |
| 128 | + with: |
| 129 | + PRODUCT_NAME: ${{ inputs.quality-product-name }} |
| 130 | + TESTING_TYPE: ${{ inputs.quality-testing-type }} |
| 131 | + SERVICE_NAME: ${{ inputs.quality-service-name }} |
| 132 | + JUNIT_REPORT: ${{ inputs.quality-junit-report }} |
61 | 133 |
|
62 | 134 | - name: Remove Storage Firewall Rule |
63 | 135 | if: always() |
|
0 commit comments