1 // Jest Snapshot v1, https://goo.gl/fbAQLP
3 exports[`should follow and complete all steps: Dart: .github/workflows/build.yml 1`] = `
12 types: [opened, synchronize, reopened]
16 name: Build and analyze
17 runs-on: ubuntu-latest
19 - <commands to build your project>
20 - name: Download sonar-scanner
22 curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.1.0.4477-linux-x64.zip
23 unzip $HOME/.sonar/sonar-scanner.zip -o -d $HOME/.sonar/
24 - name: Run sonar-scanner
26 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
27 SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
29 sonar-scanner-6.1.0.4477-linux-x64/bin/sonar-scanner \\
30 -Dsonar.projectKey=my-project"
33 exports[`should follow and complete all steps: .NET: .github/workflows/build.yml 1`] = `
41 types: [opened, synchronize, reopened]
45 name: Build and analyze
46 runs-on: windows-latest
49 - uses: actions/checkout@v4
51 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
53 uses: actions/setup-java@v4
56 distribution: 'zulu' # Alternative distribution options are available.
57 - name: Cache SonarQube packages
58 uses: actions/cache@v4
60 path: ~\\.sonar\\cache
61 key: \${{ runner.os }}-sonar
62 restore-keys: \${{ runner.os }}-sonar
63 - name: Cache SonarQube scanner
64 id: cache-sonar-scanner
65 uses: actions/cache@v4
67 path: .\\.sonar\\scanner
68 key: \${{ runner.os }}-sonar-scanner
69 restore-keys: \${{ runner.os }}-sonar-scanner
70 - name: Install SonarQube scanner
71 if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
74 New-Item -Path .\\.sonar\\scanner -ItemType Directory
75 dotnet tool update dotnet-sonarscanner --tool-path .\\.sonar\\scanner
76 - name: Build and analyze
79 .\\.sonar\\scanner\\dotnet-sonarscanner begin /k:"my-project" /d:sonar.token="\${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="\${{ secrets.SONAR_HOST_URL }}"
81 .\\.sonar\\scanner\\dotnet-sonarscanner end /d:sonar.token="\${{ secrets.SONAR_TOKEN }}""
84 exports[`should follow and complete all steps: C++ (automatic) and other: .github/workflows/build.yml 1`] = `
92 types: [opened, synchronize, reopened]
96 name: Build and analyze
97 runs-on: ubuntu-latest
100 - uses: actions/checkout@v4
102 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
103 - uses: sonarsource/sonarqube-scan-action@v3
105 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
106 SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
107 # If you wish to fail your job when the Quality Gate is red, uncomment the
108 # following lines. This would typically be used to fail a deployment.
109 # We do not recommend to use this in a pull request. Prefer using pull request
110 # decoration instead.
111 # - uses: sonarsource/sonarqube-quality-gate-action@master
114 # SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}"
117 exports[`should follow and complete all steps: C++ (automatic) and other: .github/workflows/build.yml 2`] = `
125 types: [opened, synchronize, reopened]
129 name: Build and analyze
130 runs-on: ubuntu-latest
133 - uses: actions/checkout@v4
135 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
136 - uses: sonarsource/sonarqube-scan-action@v3
138 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
139 SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
140 # If you wish to fail your job when the Quality Gate is red, uncomment the
141 # following lines. This would typically be used to fail a deployment.
142 # We do not recommend to use this in a pull request. Prefer using pull request
143 # decoration instead.
144 # - uses: sonarsource/sonarqube-quality-gate-action@master
147 # SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}"
150 exports[`should follow and complete all steps: C++ (automatic) and other: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
152 exports[`should follow and complete all steps: C++ (automatic) and other: sonar-project.properties 2`] = `"sonar.projectKey=my-project"`;
154 exports[`should follow and complete all steps: C++ Linux arm64: .github/workflows/build.yml 1`] = `
162 types: [opened, synchronize, reopened]
166 name: Build and analyze
167 runs-on: ubuntu-latest
169 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
171 - uses: actions/checkout@v4
173 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
174 - name: Install sonar-scanner and build-wrapper
176 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
177 uses: SonarSource/sonarqube-github-c-cpp@v2
178 - name: Run build-wrapper
180 build-wrapper-linux-aarch64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
181 - name: Run sonar-scanner
183 GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
184 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
185 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
187 sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
190 exports[`should follow and complete all steps: C++ Linux: .github/workflows/build.yml 1`] = `
198 types: [opened, synchronize, reopened]
202 name: Build and analyze
203 runs-on: ubuntu-latest
205 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
207 - uses: actions/checkout@v4
209 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
210 - name: Install sonar-scanner and build-wrapper
212 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
213 uses: SonarSource/sonarqube-github-c-cpp@v2
214 - name: Run build-wrapper
216 build-wrapper-linux-x86-64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
217 - name: Run sonar-scanner
219 GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
220 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
221 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
223 sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
226 exports[`should follow and complete all steps: C++ MacOS: .github/workflows/build.yml 1`] = `
234 types: [opened, synchronize, reopened]
238 name: Build and analyze
239 runs-on: macos-latest
241 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
243 - uses: actions/checkout@v4
245 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
246 - name: Install sonar-scanner and build-wrapper
248 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
249 uses: SonarSource/sonarqube-github-c-cpp@v2
250 - name: Run build-wrapper
252 build-wrapper-macosx-x86 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
253 - name: Run sonar-scanner
255 GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
256 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
257 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
259 sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
262 exports[`should follow and complete all steps: C++ Windows: .github/workflows/build.yml 1`] = `
270 types: [opened, synchronize, reopened]
274 name: Build and analyze
275 runs-on: windows-latest
277 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
279 - uses: actions/checkout@v4
281 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
282 - name: Install sonar-scanner and build-wrapper
284 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
285 uses: SonarSource/sonarqube-github-c-cpp@v2
286 - name: Run build-wrapper
288 build-wrapper-win-x86-64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
289 - name: Run sonar-scanner
291 GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
292 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
293 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
295 sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
298 exports[`should follow and complete all steps: C++: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
300 exports[`should follow and complete all steps: Gradle: .github/workflows/build.yml 1`] = `
308 types: [opened, synchronize, reopened]
312 name: Build and analyze
313 runs-on: ubuntu-latest
316 - uses: actions/checkout@v4
318 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
319 - name: Set up JDK 17
320 uses: actions/setup-java@v4
323 distribution: 'zulu' # Alternative distribution options are available.
324 - name: Cache SonarQube packages
325 uses: actions/cache@v4
328 key: \${{ runner.os }}-sonar
329 restore-keys: \${{ runner.os }}-sonar
330 - name: Cache Gradle packages
331 uses: actions/cache@v4
333 path: ~/.gradle/caches
334 key: \${{ runner.os }}-gradle-\${{ hashFiles('**/*.gradle') }}
335 restore-keys: \${{ runner.os }}-gradle
336 - name: Build and analyze
338 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
339 SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
340 run: ./gradlew build sonar --info"
343 exports[`should follow and complete all steps: Groovy: build.gradle 1`] = `
345 id "org.sonarqube" version "5.1.0.4882"
350 property "sonar.projectKey", "my-project"
351 property "sonar.projectName", "MyProject"
356 exports[`should follow and complete all steps: Kotlin: build.gradle.kts 1`] = `
358 id("org.sonarqube") version "5.1.0.4882"
363 property("sonar.projectKey", "my-project")
364 property("sonar.projectName", "MyProject")
369 exports[`should follow and complete all steps: Maven: .github/workflows/build.yml 1`] = `
377 types: [opened, synchronize, reopened]
381 name: Build and analyze
382 runs-on: ubuntu-latest
385 - uses: actions/checkout@v4
387 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
388 - name: Set up JDK 17
389 uses: actions/setup-java@v4
392 distribution: 'zulu' # Alternative distribution options are available.
393 - name: Cache SonarQube packages
394 uses: actions/cache@v4
397 key: \${{ runner.os }}-sonar
398 restore-keys: \${{ runner.os }}-sonar
399 - name: Cache Maven packages
400 uses: actions/cache@v4
403 key: \${{ runner.os }}-m2-\${{ hashFiles('**/pom.xml') }}
404 restore-keys: \${{ runner.os }}-m2
405 - name: Build and analyze
407 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
408 SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
409 run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'"
412 exports[`should follow and complete all steps: Objective-C Linux arm64: .github/workflows/build.yml 1`] = `
420 types: [opened, synchronize, reopened]
424 name: Build and analyze
425 runs-on: ubuntu-latest
427 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
429 - uses: actions/checkout@v4
431 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
432 - name: Install sonar-scanner and build-wrapper
434 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
435 uses: SonarSource/sonarqube-github-c-cpp@v2
436 - name: Run build-wrapper
438 build-wrapper-linux-aarch64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
439 - name: Run sonar-scanner
441 GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
442 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
443 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
445 sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
448 exports[`should follow and complete all steps: Objective-C Linux: .github/workflows/build.yml 1`] = `
456 types: [opened, synchronize, reopened]
460 name: Build and analyze
461 runs-on: ubuntu-latest
463 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
465 - uses: actions/checkout@v4
467 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
468 - name: Install sonar-scanner and build-wrapper
470 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
471 uses: SonarSource/sonarqube-github-c-cpp@v2
472 - name: Run build-wrapper
474 build-wrapper-linux-x86-64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
475 - name: Run sonar-scanner
477 GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
478 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
479 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
481 sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
484 exports[`should follow and complete all steps: Objective-C MacOS: .github/workflows/build.yml 1`] = `
492 types: [opened, synchronize, reopened]
496 name: Build and analyze
497 runs-on: macos-latest
499 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
501 - uses: actions/checkout@v4
503 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
504 - name: Install sonar-scanner and build-wrapper
506 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
507 uses: SonarSource/sonarqube-github-c-cpp@v2
508 - name: Run build-wrapper
510 build-wrapper-macosx-x86 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
511 - name: Run sonar-scanner
513 GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
514 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
515 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
517 sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
520 exports[`should follow and complete all steps: Objective-C Windows: .github/workflows/build.yml 1`] = `
528 types: [opened, synchronize, reopened]
532 name: Build and analyze
533 runs-on: windows-latest
535 BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
537 - uses: actions/checkout@v4
539 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
540 - name: Install sonar-scanner and build-wrapper
542 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
543 uses: SonarSource/sonarqube-github-c-cpp@v2
544 - name: Run build-wrapper
546 build-wrapper-win-x86-64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
547 - name: Run sonar-scanner
549 GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
550 SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
551 SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
553 sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
556 exports[`should follow and complete all steps: Objective-C: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
558 exports[`should follow and complete all steps: sonar token key 1`] = `"SONAR_TOKEN"`;
560 exports[`should follow and complete all steps: sonarqube host url key 1`] = `"SONAR_HOST_URL"`;
562 exports[`should follow and complete all steps: sonarqube host url value 1`] = `"http://localhost:9000"`;