Skip to content

Commit 40fab25

Browse files
authored
Integrate with SonarCloud (#822)
* Add SonarCloud * zzzprojects * BranchName * bn + pr * JAVA_HOME_17_X64 * actions/setup-java@v4 * --- * debug? * cc * collect * <CollectCoverage>true</CollectCoverage> * ignore
1 parent f0c3073 commit 40fab25

File tree

26 files changed

+30971
-64
lines changed

26 files changed

+30971
-64
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,48 @@ jobs:
2828

2929
env:
3030
IsRunningOnGitHubActions: 'true'
31+
BranchName: ${{ github.head_ref || github.ref_name }}
3132

3233
steps:
3334
- uses: actions/checkout@v4
3435

35-
- uses: actions/setup-dotnet@v4
36+
- uses: actions/setup-java@v4
3637
with:
37-
dotnet-version: |
38-
6.0.x
39-
7.0.x
40-
8.0.x
38+
distribution: 'temurin' # See 'Supported distributions' for available options
39+
java-version: '17'
40+
41+
- name: Set JAVA_HOME to JDK 17
42+
shell: pwsh
43+
run: |
44+
$jdkPath = $env:JAVA_HOME_17_X64
45+
echo "JAVA_HOME=$jdkPath" >> $GITHUB_ENV
46+
47+
- name: Install dotnet tools
48+
run: |
49+
dotnet tool install --global dotnet-sonarscanner
50+
dotnet tool install --global dotnet-coverage
51+
52+
- name: Begin analysis on SonarCloud
53+
if: github.event_name != 'pull_request'
54+
run: |
55+
dotnet sonarscanner begin /k:"zzzprojects_System.Linq.Dynamic.Core" /o:"zzzprojects" /d:sonar.branch.name=$BranchName /d:sonar.host.url="https://sonarcloud.io" /d:sonar.token=${{ secrets.SONAR_TOKEN }} /d:sonar.pullrequest.provider=github /d:sonar.dotnet.excludeTestProjects=true /d:sonar.cs.vscoveragexml.reportsPaths=**/dynamic-coverage-*.xml /d:sonar.verbose=true
4156
4257
- name: Build
4358
run: |
44-
dotnet build ./src/System.Linq.Dynamic.Core/System.Linq.Dynamic.Core.csproj -c Release -p:buildType=azure-pipelines-ci
59+
dotnet build ./src/System.Linq.Dynamic.Core/System.Linq.Dynamic.Core.csproj -c Debug -p:buildType=azure-pipelines-ci
4560
46-
- name: Run Tests EF net8.0
61+
- name: Run Tests EF net8.0 (with Coverage)
4762
run: |
48-
dotnet test ./test/EntityFramework.DynamicLinq.Tests/EntityFramework.DynamicLinq.Tests.csproj -c Release -f net8.0 -p:buildType=azure-pipelines-ci
49-
50-
- name: Run Tests EFCore net8.0
63+
dotnet-coverage collect 'dotnet test ./test/EntityFramework.DynamicLinq.Tests/EntityFramework.DynamicLinq.Tests.csproj --configuration Debug --framework net8.0 -p:buildType=azure-pipelines-ci' -f xml -o dynamic-coverage-ef.xml
64+
65+
- name: Run Tests EFCore net8.0 (with Coverage)
5166
run: |
52-
dotnet test ./test/System.Linq.Dynamic.Core.Tests/System.Linq.Dynamic.Core.Tests.csproj -c Release -p:buildType=azure-pipelines-ci
67+
dotnet-coverage collect 'dotnet test ./test/System.Linq.Dynamic.Core.Tests/System.Linq.Dynamic.Core.Tests.csproj --configuration Debug -p:buildType=azure-pipelines-ci' -f xml -o dynamic-coverage-efcore.xml
68+
69+
- name: End analysis on SonarCloud
70+
if: github.event_name != 'pull_request'
71+
run: |
72+
dotnet sonarscanner end /d:sonar.token=${{ secrets.SONAR_TOKEN }}
5373
5474
- name: Run Tests EFCore net7.0
5575
run: |

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,5 @@ _Pvt_Extensions
236236
.fake/
237237

238238
/coverage.xml
239+
/dynamic-coverage-*.xml
240+
/test/**/coverage.net8.0.opencover.xml

System.Linq.Dynamic.Core.sln

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
44
VisualStudioVersion = 17.0.31606.5
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{8463ED7E-69FB-49AE-85CF-0791AFD98E38}"
7+
ProjectSection(SolutionItems) = preProject
8+
test\Directory.Build.props = test\Directory.Build.props
9+
EndProjectSection
710
EndProject
811
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DBD7D9B6-FCC7-4650-91AF-E6457573A68F}"
912
ProjectSection(SolutionItems) = preProject

src-console/ConsoleAppEF2.0.2_InMemory/ConsoleApp_netcore2.0_EF2.0.2_InMemory.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<ItemGroup>
2020
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="2.0.2" />
2121
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.0.2" />
22-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
22+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
2323
</ItemGroup>
2424

2525
<ItemGroup>

src-console/ConsoleAppEF2.0/ConsoleApp_netcore2.0_EF2.0.1.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.1" />
1313
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.1" />
1414
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.0.1" />
15-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
15+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1616
</ItemGroup>
1717

1818
<ItemGroup>

src-console/ConsoleAppEF2.1.1/ConsoleApp_netcore2.1_EF2.1.1.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.1" />
1919
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.1" />
2020
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" />
21-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
21+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
2222
</ItemGroup>
2323

2424
<ItemGroup>

src-console/ConsoleAppEF2.1/ConsoleApp_netcore2.0_EF2.1.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="2.1.1" />
1717
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.1" />
1818
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" />
19-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
19+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
2020
</ItemGroup>
2121

2222
<ItemGroup>

src-console/ConsoleAppEF3.1/ConsoleApp_netcore3.1_EF3.1.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.0" />
2121
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.1.0" />
2222
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.0" />
23-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
23+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
2424
</ItemGroup>
2525

2626
<ItemGroup>

src-console/ConsoleAppEF5/ConsoleApp_net5.0_EF5.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.0" />
2020
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
2121
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
22-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
22+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
2323
</ItemGroup>
2424

2525
<ItemGroup>

src-console/ConsoleAppEF5_InMemory/ConsoleApp_net5.0_EF5_InMemory.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<ItemGroup>
1515
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.0" />
1616
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
17-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
17+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1818
</ItemGroup>
1919

2020
<ItemGroup>

0 commit comments

Comments
 (0)