Generate HTML Test Results report with built-in Logger #66
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build and test .NET Core 8.0 Windows | |
on: | |
push: | |
pull_request: | |
branches: [ release, development ] | |
# paths: | |
# - '**.cs' | |
# - '**.csproj' | |
env: | |
DOTNET_VERSION: '8.0.100' # The .NET SDK version to use | |
jobs: | |
build-and-test: | |
name: build-and-test-windows | |
runs-on: windows-latest | |
steps: | |
- name: Clone webprofusion/certify | |
uses: actions/checkout@master | |
with: | |
path: ./certify | |
- name: Clone webprofusion/anvil | |
uses: actions/checkout@master | |
with: | |
repository: webprofusion/anvil | |
ref: refs/heads/main | |
path: ./libs/anvil | |
- name: Clone webprofusion/certify-plugins (development branch push) | |
if: ${{ github.event_name == 'push' && contains(github.ref_name, '_dev') }} | |
uses: actions/checkout@master | |
with: | |
repository: webprofusion/certify-plugins | |
ref: refs/heads/development | |
path: ./certify-plugins | |
- name: Clone webprofusion/certify-plugins (release branch push) | |
if: ${{ github.event_name == 'push' && contains(github.ref_name, '_rel') }} | |
uses: actions/checkout@master | |
with: | |
repository: webprofusion/certify-plugins | |
ref: refs/heads/release | |
path: ./certify-plugins | |
- name: Clone webprofusion/certify-plugins (pull request) | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: actions/checkout@master | |
with: | |
repository: webprofusion/certify-plugins | |
ref: ${{ github.base_ref }} | |
path: ./certify-plugins | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@master | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Setup Step CLI | |
run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files';" | |
- name: Add Step CLI to PATH | |
run: echo "C:\Program Files\step_0.24.4\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: Pull step-ca Docker Image | |
run: docker pull jrnelson90/step-ca-win | |
- name: Install ReportGenerator Coverage Tool | |
run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 | |
- name: Install Dependencies | |
run: dotnet restore | |
working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit | |
- name: Build Certify.Core.Tests.Unit | |
run: dotnet build -c Debug --no-restore -f net8.0 | |
working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit | |
- name: Run Certify.Core.Tests.Unit Tests | |
run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger html --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 | |
working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 | |
- name: Generated HTML Coverage Report | |
run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} | |
- name: Upload Certify.Core.Tests.Unit Test Results and Coverage | |
uses: actions/upload-artifact@master | |
with: | |
name: dotnet-results-8_0-${{ runner.os }} | |
path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} | |
# Use always() to always run this step to publish test results when there are test failures | |
if: ${{ always() }} | |
# - name: Publish Test Results | |
# uses: EnricoMi/publish-unit-test-result-action/composite@v2 | |
# if: always() | |
# with: | |
# files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx | |
# - name: Code Coverage Report | |
# uses: irongut/[email protected] | |
# with: | |
# filename: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/coverage.cobertura.xml | |
# badge: true | |
# fail_below_min: false | |
# format: markdown | |
# hide_branch_rate: false | |
# hide_complexity: false | |
# indicators: true | |
# output: both | |
# thresholds: '50 70' |