]> source.dussan.org Git - sonarqube.git/blob
c37eb9b781996afa9f5c1278a8637feb1e6bb5ee
[sonarqube.git] /
1 // Jest Snapshot v1, https://goo.gl/fbAQLP
2
3 exports[`should render correctly 1`] = `
4 <Fragment>
5   <li
6     className="abs-width-600"
7   >
8     <FormattedMessage
9       defaultMessage="onboarding.tutorial.with.yaml.gradle"
10       id="onboarding.tutorial.with.yaml.gradle"
11       values={
12         Object {
13           "gradle": <React.Fragment>
14             <code
15               className="rule"
16             >
17               build.gradle
18             </code>
19             <ClipboardIconButton
20               copyValue="build.gradle"
21             />
22           </React.Fragment>,
23           "sq": <code
24             className="rule"
25           >
26             org.sonarqube
27           </code>,
28         }
29       }
30     />
31     <CodeSnippet
32       snippet="plugins {
33   id \\"org.sonarqube\\" version \\"3.3\\"
34 }
35
36 sonarqube {
37   properties {
38     property \\"sonar.projectKey\\", \\"my-project\\"
39   }
40 }"
41     />
42   </li>
43   <CreateYmlFile
44     yamlFileName=".github/workflows/build.yml"
45     yamlTemplate="name: Build
46 on:
47   push:
48     branches:
49       - master # or the name of your main branch
50   pull_request:
51     types: [opened, synchronize, reopened]
52 jobs:
53   build:
54     name: Build
55     runs-on: ubuntu-latest
56     steps:
57       - uses: actions/checkout@v2
58         with:
59           fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
60       - name: Set up JDK 11
61         uses: actions/setup-java@v1
62         with:
63           java-version: 11
64       - name: Cache SonarQube packages
65         uses: actions/cache@v1
66         with:
67           path: ~/.sonar/cache
68           key: \${{ runner.os }}-sonar
69           restore-keys: \${{ runner.os }}-sonar
70       - name: Cache Gradle packages
71         uses: actions/cache@v1
72         with:
73           path: ~/.gradle/caches
74           key: \${{ runner.os }}-gradle-\${{ hashFiles('**/*.gradle') }}
75           restore-keys: \${{ runner.os }}-gradle
76       - name: Build and analyze
77         env:
78           GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
79           SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
80           SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
81         run: ./gradlew build sonarqube --info"
82   />
83   <FinishButton
84     onClick={[MockFunction]}
85   />
86 </Fragment>
87 `;
88
89 exports[`should render correctly: without branch enabled 1`] = `
90 <Fragment>
91   <li
92     className="abs-width-600"
93   >
94     <FormattedMessage
95       defaultMessage="onboarding.tutorial.with.yaml.gradle"
96       id="onboarding.tutorial.with.yaml.gradle"
97       values={
98         Object {
99           "gradle": <React.Fragment>
100             <code
101               className="rule"
102             >
103               build.gradle
104             </code>
105             <ClipboardIconButton
106               copyValue="build.gradle"
107             />
108           </React.Fragment>,
109           "sq": <code
110             className="rule"
111           >
112             org.sonarqube
113           </code>,
114         }
115       }
116     />
117     <CodeSnippet
118       snippet="plugins {
119   id \\"org.sonarqube\\" version \\"3.3\\"
120 }
121
122 sonarqube {
123   properties {
124     property \\"sonar.projectKey\\", \\"my-project\\"
125   }
126 }"
127     />
128   </li>
129   <CreateYmlFile
130     yamlFileName=".github/workflows/build.yml"
131     yamlTemplate="name: Build
132 on:
133   push:
134     branches:
135       - master # or the name of your main branch
136
137 jobs:
138   build:
139     name: Build
140     runs-on: ubuntu-latest
141     steps:
142       - uses: actions/checkout@v2
143         with:
144           fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
145       - name: Set up JDK 11
146         uses: actions/setup-java@v1
147         with:
148           java-version: 11
149       - name: Cache SonarQube packages
150         uses: actions/cache@v1
151         with:
152           path: ~/.sonar/cache
153           key: \${{ runner.os }}-sonar
154           restore-keys: \${{ runner.os }}-sonar
155       - name: Cache Gradle packages
156         uses: actions/cache@v1
157         with:
158           path: ~/.gradle/caches
159           key: \${{ runner.os }}-gradle-\${{ hashFiles('**/*.gradle') }}
160           restore-keys: \${{ runner.os }}-gradle
161       - name: Build and analyze
162         env:
163           GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
164           SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
165           SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
166         run: ./gradlew build sonarqube --info"
167   />
168   <FinishButton
169     onClick={[MockFunction]}
170   />
171 </Fragment>
172 `;