]> source.dussan.org Git - sonarqube.git/blob
ae9060f3d7107adeb46c10e218540608ce27036e
[sonarqube.git] /
1 // Jest Snapshot v1, https://goo.gl/fbAQLP
2
3 exports[`should render correctly 1`] = `
4 <Fragment>
5   <CreateYmlFile
6     yamlFileName=".github/workflows/build.yml"
7     yamlTemplate="name: Build
8
9 on:
10   push:
11     branches:
12       - main
13   pull_request:
14     types: [opened, synchronize, reopened]
15
16 jobs:
17   build:
18     name: Build
19     runs-on: windows-latest
20     steps:
21       - uses: actions/checkout@v2
22         with:
23           fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
24       - name: Set up JDK 11
25         uses: actions/setup-java@v1
26         with:
27           java-version: 1.11
28       - name: Cache SonarQube packages
29         uses: actions/cache@v1
30         with:
31           path: ~\\sonar\\cache
32           key: \${{ runner.os }}-sonar
33           restore-keys: \${{ runner.os }}-sonar
34       - name: Cache SonarQube scanner
35         id: cache-sonar-scanner
36         uses: actions/cache@v1
37         with:
38           path: .\\.sonar\\scanner
39           key: \${{ runner.os }}-sonar-scanner
40           restore-keys: \${{ runner.os }}-sonar-scanner
41       - name: Install SonarQube scanner
42         if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
43         shell: powershell
44         run: |
45           New-Item -Path .\\.sonar\\scanner -ItemType Directory
46           dotnet tool update dotnet-sonarscanner --tool-path .\\.sonar\\scanner
47       - name: Build and analyze
48         env:
49           GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
50         shell: powershell
51         run: |
52           .\\.sonar\\scanner\\dotnet-sonarscanner begin /k:"my-project" /d:sonar.login="\${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="\${{ secrets.SONAR_HOST_URL }}"
53           dotnet build
54           .\\.sonar\\scanner\\dotnet-sonarscanner end /d:sonar.login="\${{ secrets.SONAR_TOKEN }}""
55   />
56   <FinishButton
57     onClick={[MockFunction]}
58   />
59 </Fragment>
60 `;
61
62 exports[`should render correctly: without branch enabled 1`] = `
63 <Fragment>
64   <CreateYmlFile
65     yamlFileName=".github/workflows/build.yml"
66     yamlTemplate="name: Build
67
68 on:
69   push:
70     branches:
71       - main
72
73
74 jobs:
75   build:
76     name: Build
77     runs-on: windows-latest
78     steps:
79       - uses: actions/checkout@v2
80         with:
81           fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
82       - name: Set up JDK 11
83         uses: actions/setup-java@v1
84         with:
85           java-version: 1.11
86       - name: Cache SonarQube packages
87         uses: actions/cache@v1
88         with:
89           path: ~\\sonar\\cache
90           key: \${{ runner.os }}-sonar
91           restore-keys: \${{ runner.os }}-sonar
92       - name: Cache SonarQube scanner
93         id: cache-sonar-scanner
94         uses: actions/cache@v1
95         with:
96           path: .\\.sonar\\scanner
97           key: \${{ runner.os }}-sonar-scanner
98           restore-keys: \${{ runner.os }}-sonar-scanner
99       - name: Install SonarQube scanner
100         if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
101         shell: powershell
102         run: |
103           New-Item -Path .\\.sonar\\scanner -ItemType Directory
104           dotnet tool update dotnet-sonarscanner --tool-path .\\.sonar\\scanner
105       - name: Build and analyze
106         env:
107           GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
108         shell: powershell
109         run: |
110           .\\.sonar\\scanner\\dotnet-sonarscanner begin /k:"my-project" /d:sonar.login="\${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="\${{ secrets.SONAR_HOST_URL }}"
111           dotnet build
112           .\\.sonar\\scanner\\dotnet-sonarscanner end /d:sonar.login="\${{ secrets.SONAR_TOKEN }}""
113   />
114   <FinishButton
115     onClick={[MockFunction]}
116   />
117 </Fragment>
118 `;