|
44 | 44 | - name: npm build |
45 | 45 | run: BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") BUILD_COMMIT=${{ github.sha }} npm run build |
46 | 46 |
|
| 47 | + - name: SonarQube Scan (Push) |
| 48 | + if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/master') }} |
| 49 | + uses: SonarSource/sonarcloud-github-action@v1.8 |
| 50 | + env: |
| 51 | + SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} |
| 52 | + with: |
| 53 | + projectBaseDir: . |
| 54 | + args: > |
| 55 | + -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} |
| 56 | + -Dsonar.projectName=${{ github.event.repository.name }} |
| 57 | + -Dsonar.projectKey=${{ github.event.repository.name }} |
| 58 | + -Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info |
| 59 | + -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" |
| 60 | + -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" |
| 61 | +
|
| 62 | + - name: SonarQube Scan (Pull Request) |
| 63 | + if: github.event_name == 'pull_request' |
| 64 | + uses: SonarSource/sonarcloud-github-action@v1.8 |
| 65 | + env: |
| 66 | + SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} |
| 67 | + with: |
| 68 | + projectBaseDir: . |
| 69 | + args: > |
| 70 | + -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} |
| 71 | + -Dsonar.projectName=${{ github.event.repository.name }} |
| 72 | + -Dsonar.projectKey=${{ github.event.repository.name }} |
| 73 | + -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" |
| 74 | + -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" |
| 75 | + -Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info |
| 76 | + -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} |
| 77 | + -Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} |
| 78 | + -Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }} |
| 79 | +
|
47 | 80 | - name: Store assets |
48 | 81 | if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/master') }} |
49 | 82 | uses: actions/upload-artifact@v3 |
@@ -137,36 +170,3 @@ jobs: |
137 | 170 | SOURCE_DIR: ./umd |
138 | 171 | DEST_DIR: sdk |
139 | 172 | ARGS: --acl public-read --follow-symlinks --cache-control max-age=31536000,public |
140 | | - |
141 | | - - name: SonarQube Scan (Push) |
142 | | - if: github.event_name == 'push' |
143 | | - uses: SonarSource/sonarcloud-github-action@v1.8 |
144 | | - env: |
145 | | - SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} |
146 | | - with: |
147 | | - projectBaseDir: . |
148 | | - args: > |
149 | | - -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} |
150 | | - -Dsonar.projectName=${{ github.event.repository.name }} |
151 | | - -Dsonar.projectKey=${{ github.event.repository.name }} |
152 | | - -Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info |
153 | | - -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" |
154 | | - -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" |
155 | | -
|
156 | | - - name: SonarQube Scan (Pull Request) |
157 | | - if: github.event_name == 'pull_request' |
158 | | - uses: SonarSource/sonarcloud-github-action@v1.8 |
159 | | - env: |
160 | | - SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} |
161 | | - with: |
162 | | - projectBaseDir: . |
163 | | - args: > |
164 | | - -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} |
165 | | - -Dsonar.projectName=${{ github.event.repository.name }} |
166 | | - -Dsonar.projectKey=${{ github.event.repository.name }} |
167 | | - -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" |
168 | | - -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" |
169 | | - -Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info |
170 | | - -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} |
171 | | - -Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} |
172 | | - -Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }} |
0 commit comments