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