From 2016418f8ce2ed1b232368f1149175ae851b56bc Mon Sep 17 00:00:00 2001 From: Jason Barden Date: Tue, 9 Sep 2025 21:16:45 +0100 Subject: [PATCH 1/2] NuGet updates and formatting --- .github/workflows/dotnet.yml | 62 +++ .github/workflows/main_astar-dev.yml | 22 +- .github/workflows/publish.yml | 34 ++ .../.idea/.gitignore | 0 .../.idea/.name | 1 + .../.idea/encodings.xml | 0 .../.idea/indexLayout.xml | 0 .../.idea/sonarlint.xml | 0 .../.idea/vcs.xml | 0 .idea/.idea.DatabaseTesting/.idea/.name | 1 - .../.idea.DatabaseTesting/.idea/workspace.xml | 486 ++++++++++++++++++ AStar.Dev.Database.Testing.slnx | 27 + DatabaseTesting.sln | 114 ---- .../AStar.Dev.Infrastructure.FilesDb.csproj | 14 +- .../FileClassificationConfiguration.cs | 2 +- .../Configurations/FileDetailConfiguration.cs | 4 +- .../FileNamePartConfiguration.cs | 2 +- .../Data/FileDetailPagingExtensions.cs | 2 +- .../Data/FileDetailSearchTypeExtensions.cs | 2 +- .../Data/FilesContext.cs | 2 +- .../Models/DuplicateDetail.cs | 10 +- .../Models/EventType.cs | 16 +- .../Models/FileClassification.cs | 4 +- .../Models/FileDetail.cs | 2 +- .../Models/FileNamePart.cs | 2 +- .../AStar.Dev.Infrastructure.csproj | 8 +- .../AStar.Dev.Technical.Debt.Reporting.csproj | 4 +- .../AStar.Dev.Utilities.csproj | 2 +- .../EncryptionExtensions.cs | 2 +- support/AStar.Dev.Utilities/LinqExtensions.cs | 2 +- .../DbContextHelpers/DbContextHelpers.csproj | 12 +- support/DbContextHelpers/TestConstants.cs | 2 +- ...structure.FilesDb.Tests.Integration.csproj | 8 +- ...ileDetailDeletionStatusExtensionsShould.cs | 3 +- ...FileDetailDirectoryNameExtensionsShould.cs | 3 +- .../FileDetailOrderingExtensionsShould.cs | 3 +- .../FileDetailPagingExtensionsShould.cs | 3 +- .../FileDetailSearchTypeExtensionsShould.cs | 3 +- .../FileDetailTextContainsExtensionsShould.cs | 3 +- .../FilesContextLastViewedExtensionsShould.cs | 1 - ...v.Infrastructure.FilesDb.Tests.Unit.csproj | 16 +- .../Models/DeletionStatusShould.cs | 1 - .../Models/DirectoryNameShould.cs | 3 +- .../Models/DuplicateDetailShould.cs | 9 +- .../Models/EventShould.cs | 7 +- .../Models/FileDetailShould.cs | 27 +- .../Models/FileHandleShould.cs | 2 - .../Models/FileIdShould.cs | 1 - .../Models/FileNamePartShould.cs | 6 +- .../Models/FileNameShould.cs | 3 +- .../Models/FileSizeEqualityComparerShould.cs | 1 - .../Models/FileSizeShould.cs | 1 - .../Models/ImageDetailShould.cs | 3 +- .../Models/ImageDetailsShould.cs | 2 - ...AStar.Dev.Infrastructure.Tests.Unit.csproj | 16 +- .../AuditableEntityShould.cs | 2 +- ...Technical.Debt.Reporting.Tests.Unit.csproj | 4 +- .../RefactorAttributeShould.cs | 9 +- .../AStar.Dev.Utilities.Tests.Unit.csproj | 4 +- .../StringExtensionsShould.cs | 26 +- 60 files changed, 750 insertions(+), 261 deletions(-) create mode 100644 .github/workflows/dotnet.yml create mode 100644 .github/workflows/publish.yml rename .idea/{.idea.DatabaseTesting => .idea.AStar.Dev.Database.Testing}/.idea/.gitignore (100%) create mode 100644 .idea/.idea.AStar.Dev.Database.Testing/.idea/.name rename .idea/{.idea.DatabaseTesting => .idea.AStar.Dev.Database.Testing}/.idea/encodings.xml (100%) rename .idea/{.idea.DatabaseTesting => .idea.AStar.Dev.Database.Testing}/.idea/indexLayout.xml (100%) rename .idea/{.idea.DatabaseTesting => .idea.AStar.Dev.Database.Testing}/.idea/sonarlint.xml (100%) rename .idea/{.idea.DatabaseTesting => .idea.AStar.Dev.Database.Testing}/.idea/vcs.xml (100%) delete mode 100644 .idea/.idea.DatabaseTesting/.idea/.name create mode 100644 .idea/.idea.DatabaseTesting/.idea/workspace.xml create mode 100644 AStar.Dev.Database.Testing.slnx delete mode 100644 DatabaseTesting.sln diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 0000000..d3fe03f --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,62 @@ +name: .NET + +on: + workflow_dispatch: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + name: Build and analyze + runs-on: windows-latest + env: + SONAR_PROJECT: 'astar-dev-utilities' + ProjectName: 'AStar.Dev.Utilities' + RepositoryName: 'astar-dev-utilities' + steps: + - name: Set up JDK + uses: actions/setup-java@v4.4.0 + with: + java-version: 17 + distribution: 'zulu' + + - name: Checkout + uses: actions/checkout@v4.2.1 + with: + fetch-depth: 0 + + - name: 🛠 Cache SonarQube Cloud packages + uses: actions/cache@v4.2.3 + with: + path: ~\sonar\cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + + - name: 🛠 Cache SonarQube Cloud scanner + id: cache-sonar-scanner + uses: actions/cache@v4.2.3 + with: + path: .\.sonar\scanner + key: ${{ runner.os }}-sonar-scanner + restore-keys: ${{ runner.os }}-sonar-scanner + + - name: 🛠 Install SonarQube Cloud scanner + if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' + shell: powershell + run: | + New-Item -Path .\.sonar\scanner -ItemType Directory + dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner + + - name: 🔍 Restore, 🛠 Build and 🧪 Test with ☁️ SonarCloud / Qube + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + shell: powershell + run: | + dotnet tool install --global dotnet-coverage + .\.sonar\scanner\dotnet-sonarscanner begin /k:"astar-development_${{ env.SONAR_PROJECT }}" /o:"astar-development" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml /d:sonar.scanner.scanAll=false /d:sonar.scanner.skipJreProvisioning=true + dotnet build --configuration Release + dotnet-coverage collect 'dotnet test --filter "FullyQualifiedName!~Tests.EndToEnd"' -f xml -o 'coverage.xml' + .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" diff --git a/.github/workflows/main_astar-dev.yml b/.github/workflows/main_astar-dev.yml index 05be87d..9b71b43 100644 --- a/.github/workflows/main_astar-dev.yml +++ b/.github/workflows/main_astar-dev.yml @@ -1,45 +1,55 @@ name: SonarQube + permissions: contents: read + on: push: branches: - main pull_request: types: [ opened, synchronize, reopened ] + jobs: + build: name: Build and analyze runs-on: windows-latest + steps: - name: Set up JDK 17 uses: actions/setup-java@v4 with: java-version: 17 - distribution: 'zulu' # Alternative distribution options are available. + distribution: 'zulu' + - uses: actions/checkout@v4 with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Cache SonarQube Cloud packages + fetch-depth: 0 + + - name: 🛠 Cache SonarQube Cloud packages uses: actions/cache@v4 with: path: ~\sonar\cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - - name: Cache SonarQube Cloud scanner + + - name: 🛠 Cache SonarQube Cloud scanner id: cache-sonar-scanner uses: actions/cache@v4 with: path: .\.sonar\scanner key: ${{ runner.os }}-sonar-scanner restore-keys: ${{ runner.os }}-sonar-scanner - - name: Install SonarQube Cloud scanner + + - name: ☁️ Install SonarQube Cloud scanner if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' shell: powershell run: | New-Item -Path .\.sonar\scanner -ItemType Directory dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner - - name: Build and analyze + + - name: 🛠 Build, 🧪 Test and analyse with ☁️ SonarCloud / Qube env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} shell: powershell diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..840e6b1 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,34 @@ +name: 🚀 Publish NuGet Package + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + env: + ProjectName: 'AStar.Dev.Utilities' + + steps: + - name: 🧾 Checkout code + uses: actions/checkout@v4 + + - name: 🛠 Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '9.x' + + - name: 🔍 Restore dependencies + run: dotnet restore + + - name: 🛠 Build solution + run: dotnet build --configuration Release + + - name: 📦 Pack NuGet package + run: dotnet pack ./src/${{ env.ProjectName }}/${{ env.ProjectName }}.csproj --configuration Release --output ./nupkg + + - name: 🚀 Publish to NuGet.org + run: dotnet nuget push ./nupkg/*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NuGet_API_Key }} # + diff --git a/.idea/.idea.DatabaseTesting/.idea/.gitignore b/.idea/.idea.AStar.Dev.Database.Testing/.idea/.gitignore similarity index 100% rename from .idea/.idea.DatabaseTesting/.idea/.gitignore rename to .idea/.idea.AStar.Dev.Database.Testing/.idea/.gitignore diff --git a/.idea/.idea.AStar.Dev.Database.Testing/.idea/.name b/.idea/.idea.AStar.Dev.Database.Testing/.idea/.name new file mode 100644 index 0000000..bbc6b33 --- /dev/null +++ b/.idea/.idea.AStar.Dev.Database.Testing/.idea/.name @@ -0,0 +1 @@ +AStar.Dev.Database.Testing \ No newline at end of file diff --git a/.idea/.idea.DatabaseTesting/.idea/encodings.xml b/.idea/.idea.AStar.Dev.Database.Testing/.idea/encodings.xml similarity index 100% rename from .idea/.idea.DatabaseTesting/.idea/encodings.xml rename to .idea/.idea.AStar.Dev.Database.Testing/.idea/encodings.xml diff --git a/.idea/.idea.DatabaseTesting/.idea/indexLayout.xml b/.idea/.idea.AStar.Dev.Database.Testing/.idea/indexLayout.xml similarity index 100% rename from .idea/.idea.DatabaseTesting/.idea/indexLayout.xml rename to .idea/.idea.AStar.Dev.Database.Testing/.idea/indexLayout.xml diff --git a/.idea/.idea.DatabaseTesting/.idea/sonarlint.xml b/.idea/.idea.AStar.Dev.Database.Testing/.idea/sonarlint.xml similarity index 100% rename from .idea/.idea.DatabaseTesting/.idea/sonarlint.xml rename to .idea/.idea.AStar.Dev.Database.Testing/.idea/sonarlint.xml diff --git a/.idea/.idea.DatabaseTesting/.idea/vcs.xml b/.idea/.idea.AStar.Dev.Database.Testing/.idea/vcs.xml similarity index 100% rename from .idea/.idea.DatabaseTesting/.idea/vcs.xml rename to .idea/.idea.AStar.Dev.Database.Testing/.idea/vcs.xml diff --git a/.idea/.idea.DatabaseTesting/.idea/.name b/.idea/.idea.DatabaseTesting/.idea/.name deleted file mode 100644 index bc93157..0000000 --- a/.idea/.idea.DatabaseTesting/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -DatabaseTesting \ No newline at end of file diff --git a/.idea/.idea.DatabaseTesting/.idea/workspace.xml b/.idea/.idea.DatabaseTesting/.idea/workspace.xml new file mode 100644 index 0000000..189ff4f --- /dev/null +++ b/.idea/.idea.DatabaseTesting/.idea/workspace.xml @@ -0,0 +1,486 @@ + + + + ConsoleApp1/ConsoleApp1.csproj + DatabaseTesting/DatabaseTesting.csproj + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "associatedIndex": 8 +} + + + + + + + + + + + + + + + 1753556624514 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +