From e6b165645b962cea0d85d4b0957fca1749d95c19 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Mon, 12 Feb 2024 01:46:16 +0000 Subject: [PATCH 1/4] ci: update sonarcloud project key --- .github/workflows/sonarcloud.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 7ee1360..c5acdd4 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -17,7 +17,8 @@ jobs: java-version: 1.11 - uses: actions/checkout@v3 with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + fetch-depth: 0 + - name: Cache SonarCloud packages uses: actions/cache@v1 with: @@ -39,12 +40,11 @@ jobs: dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner - name: Build and analyze env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} shell: powershell run: | - dotnet tool install JetBrains.dotCover.GlobalTool -g - .\.sonar\scanner\dotnet-sonarscanner begin /k:"oliverbooth_X10D" /o:"oliverbooth" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html + .\.sonar\scanner\dotnet-sonarscanner begin /k:"X10D" /o:"oliverbooth" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" dotnet build --no-incremental dotnet dotcover test --dcReportType=HTML .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" From 8380b9e0630a7f8e7d4aee00894bb30e042fc2c0 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Mon, 12 Feb 2024 01:50:21 +0000 Subject: [PATCH 2/4] [ci skip] docs: fix sonarcloud project key in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 183602b..a272771 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

GitHub Workflow Status GitHub Issues -Coverage +Coverage NuGet Downloads Stable Version Nightly Version From f679ec294eafe77df1fc3b2a436777d3123ff4a7 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Mon, 12 Feb 2024 02:35:17 +0000 Subject: [PATCH 3/4] fix(tests): add test to fix coverage on DateOnly.Deconstruct --- X10D.Tests/src/Time/DateOnlyTests.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/X10D.Tests/src/Time/DateOnlyTests.cs b/X10D.Tests/src/Time/DateOnlyTests.cs index 15b10ce..25dc25d 100644 --- a/X10D.Tests/src/Time/DateOnlyTests.cs +++ b/X10D.Tests/src/Time/DateOnlyTests.cs @@ -39,6 +39,18 @@ internal class DateOnlyTests Assert.That(age, Is.EqualTo(18)); } + [Test] + public void Deconstruct_ShouldDeconstruct_GivenDateOnly() + { + var date = new DateOnly(2017, 12, 31); + + date.Deconstruct(out int year, out int month, out int day); + + Assert.That(year, Is.EqualTo(2017)); + Assert.That(month, Is.EqualTo(12)); + Assert.That(day, Is.EqualTo(31)); + } + [Test] public void Deconstruct_ShouldDeconstructToTuple_GivenDateOnly() { From 52c85f349845a2e4b91c2cf8cc2aaabf92fd604e Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Mon, 12 Feb 2024 09:34:05 +0000 Subject: [PATCH 4/4] [ci skip] ci: add sonar.cs.dotcover.reportsPaths --- .github/workflows/sonarcloud.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index c5acdd4..0fade2c 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -44,7 +44,7 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} shell: powershell run: | - .\.sonar\scanner\dotnet-sonarscanner begin /k:"X10D" /o:"oliverbooth" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" + .\.sonar\scanner\dotnet-sonarscanner begin /k:"X10D" /o:"oliverbooth" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html dotnet build --no-incremental dotnet dotcover test --dcReportType=HTML .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"