]> source.dussan.org Git - sonarqube.git/blob
d431922411b02f6ab98221e0d947f01582dd77c1
[sonarqube.git] /
1 // Jest Snapshot v1, https://goo.gl/fbAQLP
2
3 exports[`should render correctly 1`] = `
4 <Fragment>
5   <DefaultProjectKey
6     component={
7       {
8         "breadcrumbs": [],
9         "key": "my-project",
10         "name": "MyProject",
11         "qualifier": "TRK",
12         "qualityGate": {
13           "isDefault": true,
14           "key": "30",
15           "name": "Sonar way",
16         },
17         "qualityProfiles": [
18           {
19             "deleted": false,
20             "key": "my-qp",
21             "language": "ts",
22             "name": "Sonar way",
23           },
24         ],
25         "tags": [],
26       }
27     }
28   />
29   <li
30     className="abs-width-600"
31   >
32     <span>
33       onboarding.build.other.os
34     </span>
35     <RenderOptions
36       label="onboarding.build.other.os"
37       onCheck={[Function]}
38       optionLabelKey="onboarding.build.other.os"
39       options={
40         [
41           "linux",
42           "win",
43           "mac",
44         ]
45       }
46     />
47   </li>
48 </Fragment>
49 `;
50
51 exports[`should render correctly for linux: branches disabled 1`] = `
52 <Fragment>
53   <DefaultProjectKey
54     component={
55       {
56         "breadcrumbs": [],
57         "key": "my-project",
58         "name": "MyProject",
59         "qualifier": "TRK",
60         "qualityGate": {
61           "isDefault": true,
62           "key": "30",
63           "name": "Sonar way",
64         },
65         "qualityProfiles": [
66           {
67             "deleted": false,
68             "key": "my-qp",
69             "language": "ts",
70             "name": "Sonar way",
71           },
72         ],
73         "tags": [],
74       }
75     }
76   />
77   <li
78     className="abs-width-600"
79   >
80     <span>
81       onboarding.build.other.os
82     </span>
83     <RenderOptions
84       checked="linux"
85       label="onboarding.build.other.os"
86       onCheck={[Function]}
87       optionLabelKey="onboarding.build.other.os"
88       options={
89         [
90           "linux",
91           "win",
92           "mac",
93         ]
94       }
95     />
96     <GithubCFamilyExampleRepositories
97       ci="github-actions"
98       className="big-spacer-top"
99       os="linux"
100     />
101   </li>
102   <CreateYmlFile
103     yamlFileName=".github/workflows/build.yml"
104     yamlTemplate="name: Build
105
106 on:
107   push:
108     branches:
109       - main
110
111
112 jobs:
113   build:
114     name: Build
115     runs-on: <image ready for your build toolchain>
116     steps:
117       - uses: actions/checkout@v2
118         with:
119           fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
120       - name: Download and install the build wrapper, build the project
121         run: |
122           mkdir $HOME/.sonar
123           curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \${{ secrets.SONAR_HOST_URL }}/static/cpp/build-wrapper-linux-x86.zip
124           unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
125           $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>
126         env:
127           SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
128
129       - name: Download and install the SonarScanner
130         env:
131           SONAR_SCANNER_VERSION: 4.6.2.2472
132         run: |
133           curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${{ env.SONAR_SCANNER_VERSION }}-linux.zip
134           unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
135           echo "$HOME/.sonar/sonar-scanner-\${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
136
137       - name: SonarQube analysis
138         run: |
139           sonar-scanner --define sonar.cfamily.build-wrapper-output=bw-output  
140         env:
141           SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
142           SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}"
143   />
144   <CompilationInfo
145     className="abs-width-800"
146   />
147   <FinishButton
148     onClick={[MockFunction]}
149   />
150 </Fragment>
151 `;
152
153 exports[`should render correctly for mac: branches enabled 1`] = `
154 <Fragment>
155   <DefaultProjectKey
156     component={
157       {
158         "breadcrumbs": [],
159         "key": "my-project",
160         "name": "MyProject",
161         "qualifier": "TRK",
162         "qualityGate": {
163           "isDefault": true,
164           "key": "30",
165           "name": "Sonar way",
166         },
167         "qualityProfiles": [
168           {
169             "deleted": false,
170             "key": "my-qp",
171             "language": "ts",
172             "name": "Sonar way",
173           },
174         ],
175         "tags": [],
176       }
177     }
178   />
179   <li
180     className="abs-width-600"
181   >
182     <span>
183       onboarding.build.other.os
184     </span>
185     <RenderOptions
186       checked="mac"
187       label="onboarding.build.other.os"
188       onCheck={[Function]}
189       optionLabelKey="onboarding.build.other.os"
190       options={
191         [
192           "linux",
193           "win",
194           "mac",
195         ]
196       }
197     />
198     <GithubCFamilyExampleRepositories
199       ci="github-actions"
200       className="big-spacer-top"
201       os="mac"
202     />
203   </li>
204   <CreateYmlFile
205     yamlFileName=".github/workflows/build.yml"
206     yamlTemplate="name: Build
207
208 on:
209   push:
210     branches:
211       - main
212   pull_request:
213     types: [opened, synchronize, reopened]
214
215 jobs:
216   build:
217     name: Build
218     runs-on: <image ready for your build toolchain>
219     steps:
220       - uses: actions/checkout@v2
221         with:
222           fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
223       - name: Download and install the build wrapper
224         run: |
225           mkdir $HOME/.sonar
226           curl -sSLo $HOME/.sonar/build-wrapper-macosx-x86.zip \${{ secrets.SONAR_HOST_URL }}/static/cpp/build-wrapper-macosx-x86.zip
227           unzip -o $HOME/.sonar/build-wrapper-macosx-x86.zip -d $HOME/.sonar/
228         env:
229           SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
230
231       - name: Download and install the SonarScanner
232         run: |
233           curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-macosx.zip
234           unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
235
236       - name: Build and analyse the project
237         run: |
238           # Potential improvement : add these paths to the PATH env var.
239           $HOME/.sonar/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir bw-output <your clean build command>
240           $HOME/.sonar/sonar-scanner-4.6.2.2472-macosx/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output
241         env:
242           SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
243           SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}"
244   />
245   <CompilationInfo
246     className="abs-width-800"
247   />
248   <FinishButton
249     onClick={[MockFunction]}
250   />
251 </Fragment>
252 `;
253
254 exports[`should render correctly for win: branches enabled 1`] = `
255 <Fragment>
256   <DefaultProjectKey
257     component={
258       {
259         "breadcrumbs": [],
260         "key": "my-project",
261         "name": "MyProject",
262         "qualifier": "TRK",
263         "qualityGate": {
264           "isDefault": true,
265           "key": "30",
266           "name": "Sonar way",
267         },
268         "qualityProfiles": [
269           {
270             "deleted": false,
271             "key": "my-qp",
272             "language": "ts",
273             "name": "Sonar way",
274           },
275         ],
276         "tags": [],
277       }
278     }
279   />
280   <li
281     className="abs-width-600"
282   >
283     <span>
284       onboarding.build.other.os
285     </span>
286     <RenderOptions
287       checked="win"
288       label="onboarding.build.other.os"
289       onCheck={[Function]}
290       optionLabelKey="onboarding.build.other.os"
291       options={
292         [
293           "linux",
294           "win",
295           "mac",
296         ]
297       }
298     />
299     <GithubCFamilyExampleRepositories
300       ci="github-actions"
301       className="big-spacer-top"
302       os="win"
303     />
304   </li>
305   <CreateYmlFile
306     yamlFileName=".github/workflows/build.yml"
307     yamlTemplate="name: Build
308
309 on:
310   push:
311     branches:
312       - main
313   pull_request:
314     types: [opened, synchronize, reopened]
315
316 jobs:
317   build:
318     name: Build
319     runs-on: <image ready for your build toolchain>
320     steps:
321       - uses: actions/checkout@v2
322         with:
323           fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
324       - name: Download and install the build wrapper
325         shell: powershell
326         run: |
327           $path = "$HOME/.sonar/build-wrapper-win-x86.zip"
328           mkdir $HOME/.sonar
329           [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
330           (New-Object System.Net.WebClient).DownloadFile("\${{ secrets.SONAR_HOST_URL }}/static/cpp/build-wrapper-win-x86.zip", $path)
331           Add-Type -AssemblyName System.IO.Compression.FileSystem
332           [System.IO.Compression.ZipFile]::ExtractToDirectory($path, "$HOME/.sonar")
333         env:
334           SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
335
336       - name: Download and install the SonarScanner
337         shell: powershell
338         run: |
339           $path = "$HOME/.sonar/sonar-scanner-cli-4.6.2.2472-windows.zip"
340           [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
341           (New-Object System.Net.WebClient).DownloadFile("https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-windows.zip", $path)
342           Add-Type -AssemblyName System.IO.Compression.FileSystem
343           [System.IO.Compression.ZipFile]::ExtractToDirectory($path, "$HOME/.sonar")
344
345       - name: Build and analyse the project
346         shell: powershell
347         run: |
348           $env:Path += ";$HOME/.sonar/build-wrapper-win-x86;$HOME/.sonar/sonar-scanner-4.6.2.2472-windows/bin"
349           build-wrapper-win-x86-64 --out-dir bw-output <your clean build command>
350           sonar-scanner.bat "-Dsonar.cfamily.build-wrapper-output=bw-output"
351         env:
352           SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
353           SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}"
354   />
355   <CompilationInfo
356     className="abs-width-800"
357   />
358   <FinishButton
359     onClick={[MockFunction]}
360   />
361 </Fragment>
362 `;