1 // Jest Snapshot v1, https://goo.gl/fbAQLP
3 exports[`should follow and complete all steps: .NET: .github/workflows/build.yml 1`] = `
11 types: [opened, synchronize, reopened]
15 name: Build and analyze
16 runs-on: windows-latest
19 - uses: actions/checkout@v4
21 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
23 uses: actions/setup-java@v1
26 - name: Cache SonarQube packages
27 uses: actions/cache@v1
29 path: ~\\.sonar\\cache
30 key: \${{ runner.os }}-sonar
31 restore-keys: \${{ runner.os }}-sonar
32 - name: Cache SonarQube scanner
33 id: cache-sonar-scanner
34 uses: actions/cache@v1
36 path: .\\.sonar\\scanner
37 key: \${{ runner.os }}-sonar-scanner
38 restore-keys: \${{ runner.os }}-sonar-scanner
39 - name: Install SonarQube scanner
40 if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
43 New-Item -Path .\\.sonar\\scanner -ItemType Directory
44 dotnet tool update dotnet-sonarscanner --tool-path .\\.sonar\\scanner
45 - name: Build and analyze
48 .\\.sonar\\scanner\\dotnet-sonarscanner begin /k:"my-project" /d:sonar.token="\${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="\${{ secrets.SONAR_HOST_URL }}"
50 .\\.sonar\\scanner\\dotnet-sonarscanner end /d:sonar.token="\${{ secrets.SONAR_TOKEN }}""
53 exports[`should follow and complete all steps: C++ (automatic) and other: .github/workflows/build.yml 1`] = `
61 types: [opened, synchronize, reopened]
65 name: Build and analyze
66 runs-on: ubuntu-latest
69 - uses: actions/checkout@v4
71 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
72 - uses: sonarsource/sonarqube-scan-action@master
74 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
75 SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
76 # If you wish to fail your job when the Quality Gate is red, uncomment the
77 # following lines. This would typically be used to fail a deployment.
78 # We do not recommend to use this in a pull request. Prefer using pull request
80 # - uses: sonarsource/sonarqube-quality-gate-action@master
83 # SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}"
86 exports[`should follow and complete all steps: C++ (automatic) and other: .github/workflows/build.yml 2`] = `
94 types: [opened, synchronize, reopened]
98 name: Build and analyze
99 runs-on: ubuntu-latest
102 - uses: actions/checkout@v4
104 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
105 - uses: sonarsource/sonarqube-scan-action@master
107 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
108 SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
109 # If you wish to fail your job when the Quality Gate is red, uncomment the
110 # following lines. This would typically be used to fail a deployment.
111 # We do not recommend to use this in a pull request. Prefer using pull request
112 # decoration instead.
113 # - uses: sonarsource/sonarqube-quality-gate-action@master
116 # SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}"
119 exports[`should follow and complete all steps: C++ (automatic) and other: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
121 exports[`should follow and complete all steps: C++ (automatic) and other: sonar-project.properties 2`] = `"sonar.projectKey=my-project"`;
123 exports[`should follow and complete all steps: C++ Linux arm64: .github/workflows/build.yml 1`] = `
131 types: [opened, synchronize, reopened]
135 name: Build and analyze
136 runs-on: ubuntu-latest
138 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
140 - uses: actions/checkout@v4
142 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
143 - name: Install sonar-scanner and build-wrapper
145 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
146 uses: SonarSource/sonarqube-github-c-cpp@v2
147 - name: Run build-wrapper
149 build-wrapper-linux-aarch64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
150 - name: Run sonar-scanner
152 GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
153 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
154 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
156 sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
159 exports[`should follow and complete all steps: C++ Linux: .github/workflows/build.yml 1`] = `
167 types: [opened, synchronize, reopened]
171 name: Build and analyze
172 runs-on: ubuntu-latest
174 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
176 - uses: actions/checkout@v4
178 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
179 - name: Install sonar-scanner and build-wrapper
181 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
182 uses: SonarSource/sonarqube-github-c-cpp@v2
183 - name: Run build-wrapper
185 build-wrapper-linux-x86-64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
186 - name: Run sonar-scanner
188 GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
189 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
190 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
192 sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
195 exports[`should follow and complete all steps: C++ MacOS: .github/workflows/build.yml 1`] = `
203 types: [opened, synchronize, reopened]
207 name: Build and analyze
208 runs-on: macos-latest
210 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
212 - uses: actions/checkout@v4
214 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
215 - name: Install sonar-scanner and build-wrapper
217 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
218 uses: SonarSource/sonarqube-github-c-cpp@v2
219 - name: Run build-wrapper
221 build-wrapper-macosx-x86 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
222 - name: Run sonar-scanner
224 GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
225 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
226 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
228 sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
231 exports[`should follow and complete all steps: C++ Windows: .github/workflows/build.yml 1`] = `
239 types: [opened, synchronize, reopened]
243 name: Build and analyze
244 runs-on: windows-latest
246 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
248 - uses: actions/checkout@v4
250 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
251 - name: Install sonar-scanner and build-wrapper
253 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
254 uses: SonarSource/sonarqube-github-c-cpp@v2
255 - name: Run build-wrapper
257 build-wrapper-win-x86-64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
258 - name: Run sonar-scanner
260 GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
261 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
262 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
264 sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
267 exports[`should follow and complete all steps: C++: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
269 exports[`should follow and complete all steps: Gradle: .github/workflows/build.yml 1`] = `
277 types: [opened, synchronize, reopened]
281 name: Build and analyze
282 runs-on: ubuntu-latest
285 - uses: actions/checkout@v4
287 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
288 - name: Set up JDK 17
289 uses: actions/setup-java@v1
292 - name: Cache SonarQube packages
293 uses: actions/cache@v1
296 key: \${{ runner.os }}-sonar
297 restore-keys: \${{ runner.os }}-sonar
298 - name: Cache Gradle packages
299 uses: actions/cache@v1
301 path: ~/.gradle/caches
302 key: \${{ runner.os }}-gradle-\${{ hashFiles('**/*.gradle') }}
303 restore-keys: \${{ runner.os }}-gradle
304 - name: Build and analyze
306 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
307 SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
308 run: ./gradlew build sonar --info"
311 exports[`should follow and complete all steps: Groovy: build.gradle 1`] = `
313 id "org.sonarqube" version "5.0.0.4638"
318 property "sonar.projectKey", "my-project"
319 property "sonar.projectName", "MyProject"
324 exports[`should follow and complete all steps: Kotlin: build.gradle.kts 1`] = `
326 id("org.sonarqube") version "5.0.0.4638"
331 property("sonar.projectKey", "my-project")
332 property("sonar.projectName", "MyProject")
337 exports[`should follow and complete all steps: Maven: .github/workflows/build.yml 1`] = `
345 types: [opened, synchronize, reopened]
349 name: Build and analyze
350 runs-on: ubuntu-latest
353 - uses: actions/checkout@v4
355 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
356 - name: Set up JDK 17
357 uses: actions/setup-java@v1
360 - name: Cache SonarQube packages
361 uses: actions/cache@v1
364 key: \${{ runner.os }}-sonar
365 restore-keys: \${{ runner.os }}-sonar
366 - name: Cache Maven packages
367 uses: actions/cache@v1
370 key: \${{ runner.os }}-m2-\${{ hashFiles('**/pom.xml') }}
371 restore-keys: \${{ runner.os }}-m2
372 - name: Build and analyze
374 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
375 SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
376 run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'"
379 exports[`should follow and complete all steps: Objective-C Linux arm64: .github/workflows/build.yml 1`] = `
387 types: [opened, synchronize, reopened]
391 name: Build and analyze
392 runs-on: ubuntu-latest
394 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
396 - uses: actions/checkout@v4
398 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
399 - name: Install sonar-scanner and build-wrapper
401 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
402 uses: SonarSource/sonarqube-github-c-cpp@v2
403 - name: Run build-wrapper
405 build-wrapper-linux-aarch64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
406 - name: Run sonar-scanner
408 GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
409 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
410 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
412 sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
415 exports[`should follow and complete all steps: Objective-C Linux: .github/workflows/build.yml 1`] = `
423 types: [opened, synchronize, reopened]
427 name: Build and analyze
428 runs-on: ubuntu-latest
430 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
432 - uses: actions/checkout@v4
434 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
435 - name: Install sonar-scanner and build-wrapper
437 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
438 uses: SonarSource/sonarqube-github-c-cpp@v2
439 - name: Run build-wrapper
441 build-wrapper-linux-x86-64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
442 - name: Run sonar-scanner
444 GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
445 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
446 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
448 sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
451 exports[`should follow and complete all steps: Objective-C MacOS: .github/workflows/build.yml 1`] = `
459 types: [opened, synchronize, reopened]
463 name: Build and analyze
464 runs-on: macos-latest
466 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
468 - uses: actions/checkout@v4
470 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
471 - name: Install sonar-scanner and build-wrapper
473 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
474 uses: SonarSource/sonarqube-github-c-cpp@v2
475 - name: Run build-wrapper
477 build-wrapper-macosx-x86 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
478 - name: Run sonar-scanner
480 GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
481 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
482 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
484 sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
487 exports[`should follow and complete all steps: Objective-C Windows: .github/workflows/build.yml 1`] = `
495 types: [opened, synchronize, reopened]
499 name: Build and analyze
500 runs-on: windows-latest
502 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
504 - uses: actions/checkout@v4
506 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
507 - name: Install sonar-scanner and build-wrapper
509 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
510 uses: SonarSource/sonarqube-github-c-cpp@v2
511 - name: Run build-wrapper
513 build-wrapper-win-x86-64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
514 - name: Run sonar-scanner
516 GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
517 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
518 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
520 sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
523 exports[`should follow and complete all steps: Objective-C: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
525 exports[`should follow and complete all steps: sonar token key 1`] = `"SONAR_TOKEN"`;
527 exports[`should follow and complete all steps: sonarqube host url key 1`] = `"SONAR_HOST_URL"`;
529 exports[`should follow and complete all steps: sonarqube host url value 1`] = `"http://localhost:9000"`;