You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GithubActionTutorial-it.tsx.snap 9.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. // Jest Snapshot v1, https://goo.gl/fbAQLP
  2. exports[`should follow and complete all steps: .NET: .github/workflows/build.yml 1`] = `
  3. "name: Build
  4. on:
  5. push:
  6. branches:
  7. - main
  8. pull_request:
  9. types: [opened, synchronize, reopened]
  10. jobs:
  11. build:
  12. name: Build and analyze
  13. runs-on: windows-latest
  14. steps:
  15. - uses: actions/checkout@v4
  16. with:
  17. fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
  18. - name: Set up JDK 17
  19. uses: actions/setup-java@v1
  20. with:
  21. java-version: 17
  22. - name: Cache SonarQube packages
  23. uses: actions/cache@v1
  24. with:
  25. path: ~\\.sonar\\cache
  26. key: \${{ runner.os }}-sonar
  27. restore-keys: \${{ runner.os }}-sonar
  28. - name: Cache SonarQube scanner
  29. id: cache-sonar-scanner
  30. uses: actions/cache@v1
  31. with:
  32. path: .\\.sonar\\scanner
  33. key: \${{ runner.os }}-sonar-scanner
  34. restore-keys: \${{ runner.os }}-sonar-scanner
  35. - name: Install SonarQube scanner
  36. if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
  37. shell: powershell
  38. run: |
  39. New-Item -Path .\\.sonar\\scanner -ItemType Directory
  40. dotnet tool update dotnet-sonarscanner --tool-path .\\.sonar\\scanner
  41. - name: Build and analyze
  42. shell: powershell
  43. run: |
  44. .\\.sonar\\scanner\\dotnet-sonarscanner begin /k:"my-project" /d:sonar.token="\${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="\${{ secrets.SONAR_HOST_URL }}"
  45. dotnet build
  46. .\\.sonar\\scanner\\dotnet-sonarscanner end /d:sonar.token="\${{ secrets.SONAR_TOKEN }}""
  47. `;
  48. exports[`should follow and complete all steps: CFamily Linux: .github/workflows/build.yml 1`] = `
  49. "name: Build
  50. on:
  51. push:
  52. branches:
  53. - main
  54. pull_request:
  55. types: [opened, synchronize, reopened]
  56. jobs:
  57. build:
  58. name: Build and analyze
  59. runs-on: ubuntu-latest
  60. env:
  61. BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
  62. steps:
  63. - uses: actions/checkout@v4
  64. with:
  65. fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
  66. - name: Install sonar-scanner and build-wrapper
  67. env:
  68. SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
  69. uses: SonarSource/sonarqube-github-c-cpp@v1
  70. - name: Run build-wrapper
  71. run: |
  72. build-wrapper-linux-x86-64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
  73. - name: Run sonar-scanner
  74. env:
  75. GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
  76. SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
  77. SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
  78. run: |
  79. sonar-scanner --define sonar.cfamily.build-wrapper-output="\${{ env.BUILD_WRAPPER_OUT_DIR }}""
  80. `;
  81. exports[`should follow and complete all steps: CFamily MacOS: .github/workflows/build.yml 1`] = `
  82. "name: Build
  83. on:
  84. push:
  85. branches:
  86. - main
  87. pull_request:
  88. types: [opened, synchronize, reopened]
  89. jobs:
  90. build:
  91. name: Build and analyze
  92. runs-on: macos-latest
  93. env:
  94. BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
  95. steps:
  96. - uses: actions/checkout@v4
  97. with:
  98. fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
  99. - name: Install sonar-scanner and build-wrapper
  100. env:
  101. SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
  102. uses: SonarSource/sonarqube-github-c-cpp@v1
  103. - name: Run build-wrapper
  104. run: |
  105. build-wrapper-macosx-x86 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
  106. - name: Run sonar-scanner
  107. env:
  108. GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
  109. SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
  110. SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
  111. run: |
  112. sonar-scanner --define sonar.cfamily.build-wrapper-output="\${{ env.BUILD_WRAPPER_OUT_DIR }}""
  113. `;
  114. exports[`should follow and complete all steps: CFamily Windows: .github/workflows/build.yml 1`] = `
  115. "name: Build
  116. on:
  117. push:
  118. branches:
  119. - main
  120. pull_request:
  121. types: [opened, synchronize, reopened]
  122. jobs:
  123. build:
  124. name: Build and analyze
  125. runs-on: windows-latest
  126. env:
  127. BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
  128. steps:
  129. - uses: actions/checkout@v4
  130. with:
  131. fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
  132. - name: Install sonar-scanner and build-wrapper
  133. env:
  134. SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
  135. uses: SonarSource/sonarqube-github-c-cpp@v1
  136. - name: Run build-wrapper
  137. run: |
  138. build-wrapper-win-x86-64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
  139. - name: Run sonar-scanner
  140. env:
  141. GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
  142. SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
  143. SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
  144. run: |
  145. sonar-scanner --define sonar.cfamily.build-wrapper-output="\${{ env.BUILD_WRAPPER_OUT_DIR }}""
  146. `;
  147. exports[`should follow and complete all steps: CFamily: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
  148. exports[`should follow and complete all steps: Gradle: .github/workflows/build.yml 1`] = `
  149. "name: Build
  150. on:
  151. push:
  152. branches:
  153. - main
  154. pull_request:
  155. types: [opened, synchronize, reopened]
  156. jobs:
  157. build:
  158. name: Build and analyze
  159. runs-on: ubuntu-latest
  160. steps:
  161. - uses: actions/checkout@v4
  162. with:
  163. fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
  164. - name: Set up JDK 17
  165. uses: actions/setup-java@v1
  166. with:
  167. java-version: 17
  168. - name: Cache SonarQube packages
  169. uses: actions/cache@v1
  170. with:
  171. path: ~/.sonar/cache
  172. key: \${{ runner.os }}-sonar
  173. restore-keys: \${{ runner.os }}-sonar
  174. - name: Cache Gradle packages
  175. uses: actions/cache@v1
  176. with:
  177. path: ~/.gradle/caches
  178. key: \${{ runner.os }}-gradle-\${{ hashFiles('**/*.gradle') }}
  179. restore-keys: \${{ runner.os }}-gradle
  180. - name: Build and analyze
  181. env:
  182. SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
  183. SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
  184. run: ./gradlew build sonar --info"
  185. `;
  186. exports[`should follow and complete all steps: Groovy: build.gradle 1`] = `
  187. "plugins {
  188. id "org.sonarqube" version "4.4.1.3373"
  189. }
  190. sonar {
  191. properties {
  192. property "sonar.projectKey", "my-project"
  193. property "sonar.projectName", "MyProject"
  194. }
  195. }"
  196. `;
  197. exports[`should follow and complete all steps: Kotlin: build.gradle.kts 1`] = `
  198. "plugins {
  199. id("org.sonarqube") version "4.4.1.3373"
  200. }
  201. sonar {
  202. properties {
  203. property("sonar.projectKey", "my-project")
  204. property("sonar.projectName", "MyProject")
  205. }
  206. }"
  207. `;
  208. exports[`should follow and complete all steps: Maven: .github/workflows/build.yml 1`] = `
  209. "name: Build
  210. on:
  211. push:
  212. branches:
  213. - main
  214. pull_request:
  215. types: [opened, synchronize, reopened]
  216. jobs:
  217. build:
  218. name: Build and analyze
  219. runs-on: ubuntu-latest
  220. steps:
  221. - uses: actions/checkout@v4
  222. with:
  223. fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
  224. - name: Set up JDK 17
  225. uses: actions/setup-java@v1
  226. with:
  227. java-version: 17
  228. - name: Cache SonarQube packages
  229. uses: actions/cache@v1
  230. with:
  231. path: ~/.sonar/cache
  232. key: \${{ runner.os }}-sonar
  233. restore-keys: \${{ runner.os }}-sonar
  234. - name: Cache Maven packages
  235. uses: actions/cache@v1
  236. with:
  237. path: ~/.m2
  238. key: \${{ runner.os }}-m2-\${{ hashFiles('**/pom.xml') }}
  239. restore-keys: \${{ runner.os }}-m2
  240. - name: Build and analyze
  241. env:
  242. SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
  243. SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
  244. run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'"
  245. `;
  246. exports[`should follow and complete all steps: Other: .github/workflows/build.yml 1`] = `
  247. "name: Build
  248. on:
  249. push:
  250. branches:
  251. - main
  252. pull_request:
  253. types: [opened, synchronize, reopened]
  254. jobs:
  255. build:
  256. name: Build and analyze
  257. runs-on: ubuntu-latest
  258. steps:
  259. - uses: actions/checkout@v4
  260. with:
  261. fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
  262. - uses: sonarsource/sonarqube-scan-action@master
  263. env:
  264. SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
  265. SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
  266. # If you wish to fail your job when the Quality Gate is red, uncomment the
  267. # following lines. This would typically be used to fail a deployment.
  268. # We do not recommend to use this in a pull request. Prefer using pull request
  269. # decoration instead.
  270. # - uses: sonarsource/sonarqube-quality-gate-action@master
  271. # timeout-minutes: 5
  272. # env:
  273. # SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}"
  274. `;
  275. exports[`should follow and complete all steps: Other: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
  276. exports[`should follow and complete all steps: sonar token key 1`] = `"SONAR_TOKEN"`;
  277. exports[`should follow and complete all steps: sonarqube host url key 1`] = `"SONAR_HOST_URL"`;
  278. exports[`should follow and complete all steps: sonarqube host url value 1`] = `"http://localhost:9000"`;