diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 0000000..d4454d1 --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,64 @@ +name: .NET + +on: + workflow_dispatch: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + name: Build and analyze + runs-on: windows-latest + permissions: + contents: read + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +