]> source.dussan.org Git - sonarqube.git/blob
112dd555078dca8654c155e1746722ad2ffd1f73
[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: Download and install the SonarScanner
121         env:
122           SONAR_SCANNER_VERSION: 4.6.2.2472
123         run: |
124           curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${{ env.SONAR_SCANNER_VERSION }}-linux.zip
125           unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
126           echo \\"$HOME/.sonar/sonar-scanner-\${{ env.SONAR_SCANNER_VERSION }}-linux/bin\\" >> $GITHUB_PATH
127
128       - name: SonarQube analysis
129         run: |
130           sonar-scanner --define sonar.cfamily.build-wrapper-output=bw-output  
131         env:
132           SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
133           SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
134 "
135   />
136   <CompilationInfo
137     className="abs-width-800"
138   />
139   <FinishButton
140     onClick={[MockFunction]}
141   />
142 </Fragment>
143 `;
144
145 exports[`should render correctly for mac: branches enabled 1`] = `
146 <Fragment>
147   <DefaultProjectKey
148     component={
149       Object {
150         "breadcrumbs": Array [],
151         "key": "my-project",
152         "name": "MyProject",
153         "qualifier": "TRK",
154         "qualityGate": Object {
155           "isDefault": true,
156           "key": "30",
157           "name": "Sonar way",
158         },
159         "qualityProfiles": Array [
160           Object {
161             "deleted": false,
162             "key": "my-qp",
163             "language": "ts",
164             "name": "Sonar way",
165           },
166         ],
167         "tags": Array [],
168       }
169     }
170   />
171   <li>
172     <span>
173       onboarding.build.other.os
174     </span>
175     <RenderOptions
176       checked="mac"
177       name="os"
178       onCheck={[Function]}
179       optionLabelKey="onboarding.build.other.os"
180       options={
181         Array [
182           "linux",
183           "win",
184           "mac",
185         ]
186       }
187     />
188   </li>
189   <CreateYmlFile
190     yamlFileName=".github/workflows/build.yml"
191     yamlTemplate="name: Build
192 on:
193   push:
194     branches:
195       - master # or the name of your main branch
196   pull_request:
197     types: [opened, synchronize, reopened]
198
199 jobs:
200   build:
201     runs-on: <image ready for your build toolchain>
202     steps:
203       - name: Checkout code
204         uses: actions/checkout@v2
205         with:
206           fetch-depth: 0
207
208       - name: Download and install the build wrapper
209         run: |
210           mkdir $HOME/.sonar
211           curl -sSLo $HOME/.sonar/build-wrapper-macosx-x86.zip \${{ secrets.SONAR_HOST_URL }}/static/cpp/build-wrapper-macosx-x86.zip
212           unzip -o $HOME/.sonar/build-wrapper-macosx-x86.zip -d $HOME/.sonar/
213         env:
214           SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
215
216       - name: Download and install the SonarScanner
217         run: |
218           curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-macosx.zip
219           unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
220
221       - name: Build and analyse the project
222         run: |
223           # Potential improvement : add these paths to the PATH env var.
224           $HOME/.sonar/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir bw-output <your clean build command>
225           $HOME/.sonar/sonar-scanner-4.6.2.2472-macosx/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output
226         env:
227           SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
228           SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
229 "
230   />
231   <CompilationInfo
232     className="abs-width-800"
233   />
234   <FinishButton
235     onClick={[MockFunction]}
236   />
237 </Fragment>
238 `;
239
240 exports[`should render correctly for win: branches enabled 1`] = `
241 <Fragment>
242   <DefaultProjectKey
243     component={
244       Object {
245         "breadcrumbs": Array [],
246         "key": "my-project",
247         "name": "MyProject",
248         "qualifier": "TRK",
249         "qualityGate": Object {
250           "isDefault": true,
251           "key": "30",
252           "name": "Sonar way",
253         },
254         "qualityProfiles": Array [
255           Object {
256             "deleted": false,
257             "key": "my-qp",
258             "language": "ts",
259             "name": "Sonar way",
260           },
261         ],
262         "tags": Array [],
263       }
264     }
265   />
266   <li>
267     <span>
268       onboarding.build.other.os
269     </span>
270     <RenderOptions
271       checked="win"
272       name="os"
273       onCheck={[Function]}
274       optionLabelKey="onboarding.build.other.os"
275       options={
276         Array [
277           "linux",
278           "win",
279           "mac",
280         ]
281       }
282     />
283   </li>
284   <CreateYmlFile
285     yamlFileName=".github/workflows/build.yml"
286     yamlTemplate="name: Build
287 on:
288   push:
289     branches:
290       - master # or the name of your main branch
291   pull_request:
292     types: [opened, synchronize, reopened]
293
294 jobs:
295   build:
296     runs-on: <image ready for your build toolchain>
297     steps:
298       - name: Checkout code
299         uses: actions/checkout@v2
300         with:
301           fetch-depth: 0
302
303       - name: Download and install the build wrapper
304         shell: powershell
305         run: |
306           $path = \\"$HOME/.sonar/build-wrapper-win-x86.zip\\"
307           mkdir $HOME/.sonar
308           [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
309           (New-Object System.Net.WebClient).DownloadFile(\\"\${{ secrets.SONAR_HOST_URL }}/static/cpp/build-wrapper-win-x86.zip\\", $path)
310           Add-Type -AssemblyName System.IO.Compression.FileSystem
311           [System.IO.Compression.ZipFile]::ExtractToDirectory($path, \\"$HOME/.sonar\\")
312         env:
313           SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
314
315       - name: Download and install the SonarScanner
316         shell: powershell
317         run: |
318           $path = \\"$HOME/.sonar/sonar-scanner-cli-4.6.2.2472-windows.zip\\"
319           [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
320           (New-Object System.Net.WebClient).DownloadFile(\\"https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-windows.zip\\", $path)
321           Add-Type -AssemblyName System.IO.Compression.FileSystem
322           [System.IO.Compression.ZipFile]::ExtractToDirectory($path, \\"$HOME/.sonar\\")
323
324       - name: Build and analyse the project
325         shell: powershell
326         run: |
327           $env:Path += \\";$HOME/.sonar/build-wrapper-win-x86;$HOME/.sonar/sonar-scanner-4.6.2.2472-windows/bin\\"
328           build-wrapper-win-x86-64 --out-dir bw-output <your clean build command>
329           sonar-scanner.bat \\"-Dsonar.cfamily.build-wrapper-output=bw-output\\"
330         env:
331           SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
332           SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
333 "
334   />
335   <CompilationInfo
336     className="abs-width-800"
337   />
338   <FinishButton
339     onClick={[MockFunction]}
340   />
341 </Fragment>
342 `;