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