Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 38 additions & 7 deletions .github/workflows/gtc-rg-semkernel-api-ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,25 @@ jobs:
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: dotnet-results-${{ matrix.DOTNET_VERSION }}
name: test-results-dotnet-${{ matrix.DOTNET_VERSION }}
path: TestResults-${{ matrix.DOTNET_VERSION }}
if: ${{ always() }}

- name: Run Coverage Script
run: |
pwsh ${{ env.SRC_PATH }}/Get-CodeCoverage.ps1 `
-TestProjectFilter '${{ env.TEST_PROJECT }}' `
-ProdPackagesOnly `
-ProductionAssemblies Cannery.Insights.Core.Application Cannery.Insights.Presentation.WebApi Cannery.Insights.Presentation.Blazor
shell: pwsh

- name: Upload Coverage Report
uses: actions/upload-artifact@v4
with:
name: coverage-report-${{ matrix.DOTNET_VERSION }}
path: ${{ env.SRC_PATH }}/TestResults/Reports/**/index.html
if: ${{ always() }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

Expand Down Expand Up @@ -187,24 +202,40 @@ jobs:

- name: Test
run: |
dotnet test ${{ env.SRC_PATH }}/${{ env.TEST_PATH }}/${{ env.TEST_PROJECT }} --logger "trx;LogFileName=TestResults-${{ matrix.DOTNET_VERSION }}/test_results.trx" --verbosity normal
mkdir -p TestResults-${{ matrix.DOTNET_VERSION }}
dotnet test ${{ env.SRC_PATH }}/${{ env.TEST_PATH }}/${{ env.TEST_PROJECT }} --logger "trx;LogFileName=test_results.trx" --results-directory TestResults-${{ matrix.DOTNET_VERSION }} --verbosity normal
shell: pwsh

- name: Publish
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-results-dotnet-${{ matrix.DOTNET_VERSION }}
path: TestResults-${{ matrix.DOTNET_VERSION }}
if: ${{ always() }}

- name: Run Coverage Script
run: |
dotnet publish ${{ env.SRC_PATH }}/${{ env.API_PATH }}/${{ env.API_PROJECT }} --configuration Release -o ${{ env.AZURE_WEBAPP_NAME }}
pwsh ${{ env.SRC_PATH }}/Get-CodeCoverage.ps1 `
-TestProjectFilter '${{ env.TEST_PROJECT }}' `
-ProdPackagesOnly `
-ProductionAssemblies Cannery.Insights.Core.Application Cannery.Insights.Presentation.WebApi Cannery.Insights.Presentation.Blazor
shell: pwsh

- name: dotnet test results
- name: Upload Coverage Report
uses: actions/upload-artifact@v4
with:
name: dotnet-results-${{ matrix.DOTNET_VERSION }}
path: TestResults-${{ matrix.DOTNET_VERSION }}
name: coverage-report-${{ matrix.DOTNET_VERSION }}
path: ${{ env.SRC_PATH }}/TestResults/Reports/**/index.html
if: ${{ always() }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

- name: Publish
run: |
dotnet publish ${{ env.SRC_PATH }}/${{ env.API_PATH }}/${{ env.API_PROJECT }} --configuration Release -o ${{ env.AZURE_WEBAPP_NAME }}
shell: pwsh

- name: az login
uses: azure/login@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions src/Get-CodeCoverage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Param(
)
)
####################################################################################
Set-ExecutionPolicy Unrestricted -Scope Process -Force
if ($IsWindows) {Set-ExecutionPolicy Unrestricted -Scope Process -Force}
$VerbosePreference = 'SilentlyContinue' # 'Continue'
####################################################################################

Expand Down Expand Up @@ -50,7 +50,7 @@ foreach ($project in $testProjects) {

# Generate HTML report
if ($ProdPackagesOnly) {

$assemblyFilters = ($ProductionAssemblies | ForEach-Object { "+$_" }) -join ";"
$assemblyFilters = ($ProductionAssemblies | ForEach-Object { "+$_" }) -join ";"
& reportgenerator -reports:"$coverageOutputPath/**/coverage.cobertura.xml" -targetdir:$reportOutputPath -reporttypes:Html -assemblyfilters:$assemblyFilters
}
Expand Down
Loading