diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index fe1152b..0000000 --- a/.dockerignore +++ /dev/null @@ -1,30 +0,0 @@ -**/.classpath -**/.dockerignore -**/.env -**/.git -**/.gitignore -**/.project -**/.settings -**/.toolstarget -**/.vs -**/.vscode -**/*.*proj.user -**/*.dbmdl -**/*.jfm -**/azds.yaml -**/bin -**/charts -**/docker-compose* -**/Dockerfile* -**/node_modules -**/npm-debug.log -**/obj -**/secrets.dev.yaml -**/values.dev.yaml -LICENSE -README.md -!**/.gitignore -!.git/HEAD -!.git/config -!.git/packed-refs -!.git/refs/heads/** \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3319c11..1fe6468 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,21 +38,30 @@ jobs: - name: Install .NET uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} - name: Restore solution - run: dotnet restore + run: dotnet restore ${{ env.SOLUTION_PATH }} - name: Build solution - run: dotnet build --no-restore --configuration Release - - - name: Test solution - run: dotnet test --no-build --configuration Release --filter "FullyQualifiedName!~AcceptanceTests" + run: dotnet build ${{ env.SOLUTION_PATH }} --no-restore --configuration Release + + - name: Test solution with coverage + run: | + dotnet test ${{ env.SOLUTION_PATH }} --no-build --configuration Release --collect:"Code Coverage" --results-directory ./TestResults -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover - - name: Analyze with SonarCloud + - name: SonarCloud Scan uses: sonarsource/sonarcloud-github-action@v3.0.0 env: SONAR_TOKEN: ${{ secrets.SONARCLOUND_TOKEN }} - + with: + args: > + -Dsonar.projectKey=christianrd_FastCleanArchitecture + -Dsonar.organization=christianrd + -Dsonar.cs.opencover.reportPaths=TestResults/coverage.opencover.xml + -Dsonar.Tests=tests/ + - name: Publish website if: ${{ inputs.build-artifacts == true }} run: | @@ -67,42 +76,4 @@ jobs: with: name: website path: ./src/API/publish/publish.zip - if-no-files-found: error - - - name: Create EF Core migrations bundle - Install tool-manifest - if: ${{ inputs.build-artifacts == true }} - run: | - dotnet new tool-manifest - env: - SkipNSwag: True - - - name: Create EF Core migrations bundle - Install dotnet-ef - if: ${{ inputs.build-artifacts == true }} - run: | - dotnet tool install dotnet-ef --version 8.0.1 - env: - SkipNSwag: True - - - - name: Create EF Core migrations bundle - bundle migrations - if: ${{ inputs.build-artifacts == true }} - run: | - dotnet ef migrations bundle --configuration Release -p ./src/Infrastructure/ -s ./src/API/ -o efbundle.exe - env: - SkipNSwag: True - - - - name: Create EF Core migrations bundle - zip migrations bundle - if: ${{ inputs.build-artifacts == true }} - run: | - zip -r ./efbundle.zip efbundle.exe - env: - SkipNSwag: True - - - name: Upload EF Core migrations bundle artifact (efbundle) - if: ${{ inputs.build-artifacts == true }} - uses: actions/upload-artifact@v4 - with: - name: efbundle - path: ./efbundle.zip if-no-files-found: error \ No newline at end of file diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index f133200..0000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: CodeQL - -on: - push: - branches: [ develop ] - paths-ignore: - - .gitignore - - CODE_OF_CONDUCT.md - - LICENSE - - README.md - - pull_request: - branches: [ develop ] - paths-ignore: - - .gitignore - - CODE_OF_CONDUCT.md - - LICENSE - - README.md - - schedule: - - cron: '00 0 * * 1' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - security-events: write - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/README.md b/README.md index 8f5dc5f..b9e0215 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Nuget](https://img.shields.io/nuget/v/Fast.Clean.Architecture.Solution.Template?label=NuGet)](https://www.nuget.org/packages/Fast.Clean.Architecture.Solution.Template) [![Nuget](https://img.shields.io/nuget/dt/Fast.Clean.Architecture.Solution.Template?label=Downloads)](https://www.nuget.org/packages/Fast.Clean.Architecture.Solution.Template) -[![Quality gate](https://sonarcloud.io/api/project_badges/quality_gate?project=christianrd_FastCleanArchitecture)](https://sonarcloud.io/summary/new_code?id=christianrd_FastCleanArchitecture) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=christianrd_FastCleanArchitecture&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=christianrd_FastCleanArchitecture) The purpose of this template is to offer a simple and effective solution for building enterprise applications by harnessing the capabilities of Clean Architecture and ASP.NET Core. diff --git a/docker-compose.dcproj b/docker-compose.dcproj deleted file mode 100644 index 4e64cc9..0000000 --- a/docker-compose.dcproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - 2.1 - Linux - 34bb3069-d5d0-4046-acad-a2025ed7678f - LaunchBrowser - {Scheme}://localhost:{ServicePort}/swagger - api - fast-clean-architecture - - - - docker-compose.yml - - - - - \ No newline at end of file diff --git a/docker-compose.override.yml b/docker-compose.override.yml deleted file mode 100644 index 320d3d1..0000000 --- a/docker-compose.override.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: '3.4' - -services: - api: - environment: - - ASPNETCORE_ENVIRONMENT=Development - - ASPNETCORE_HTTP_PORTS=8080 - - ASPNETCORE_HTTPS_PORTS=8081 - ports: - - "8080" - - "8081" - volumes: - - ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro - - ${APPDATA}/ASP.NET/Https:/root/.aspnet/https:ro \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index b6aaba2..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,27 +0,0 @@ -version: '3.4' - -services: - api: - image: ${DOCKER_REGISTRY-}api - container_name: API - build: - context: . - dockerfile: src/API/Dockerfile - depends_on: - - mssql - ports: - - 5000:8080 - - 5001:8081 - - mssql: - image: mcr.microsoft.com/mssql/server:2022-latest - container_name: mssql - environment: - - ACCEPT_EULA=Y - - MSSQL_SA_PASSWORD=admin.123 - - MSSQL_PID=Developer - - MSSQL_DB=fast-clean-architecture - volumes: - - ./.containers/mssql:/var/opt/mssql - ports: - - 1433:1433 \ No newline at end of file diff --git a/fastCleanArchitecture.sln b/fastCleanArchitecture.sln index 9ef2764..39a9840 100644 --- a/fastCleanArchitecture.sln +++ b/fastCleanArchitecture.sln @@ -29,9 +29,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ArchitectureTests", "tests\ArchitectureTests\ArchitectureTests.csproj", "{49D62606-1540-475F-94F8-315CBE04728D}" EndProject -Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{34BB3069-D5D0-4046-ACAD-A2025ED7678F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Application.IntegrationTests", "tests\Application.IntegrationTests\Application.IntegrationTests.csproj", "{F1F77627-2298-4497-8016-943605A752ED}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Application.IntegrationTests", "tests\Application.IntegrationTests\Application.IntegrationTests.csproj", "{F1F77627-2298-4497-8016-943605A752ED}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -67,10 +65,6 @@ Global {49D62606-1540-475F-94F8-315CBE04728D}.Debug|Any CPU.Build.0 = Debug|Any CPU {49D62606-1540-475F-94F8-315CBE04728D}.Release|Any CPU.ActiveCfg = Release|Any CPU {49D62606-1540-475F-94F8-315CBE04728D}.Release|Any CPU.Build.0 = Release|Any CPU - {34BB3069-D5D0-4046-ACAD-A2025ED7678F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {34BB3069-D5D0-4046-ACAD-A2025ED7678F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {34BB3069-D5D0-4046-ACAD-A2025ED7678F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {34BB3069-D5D0-4046-ACAD-A2025ED7678F}.Release|Any CPU.Build.0 = Release|Any CPU {F1F77627-2298-4497-8016-943605A752ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F1F77627-2298-4497-8016-943605A752ED}.Debug|Any CPU.Build.0 = Debug|Any CPU {F1F77627-2298-4497-8016-943605A752ED}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/launchSettings.json b/launchSettings.json deleted file mode 100644 index 5c0ff34..0000000 --- a/launchSettings.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "profiles": { - "Docker Compose": { - "commandName": "DockerCompose", - "commandVersion": "1.0", - "serviceActions": { - "API": "StartDebugging" - } - } - } -} \ No newline at end of file