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