Skip to content

Debug GITHUB_WORKSPACE value for Tyrrrz/GitHubActionsTestLogger #88

Debug GITHUB_WORKSPACE value for Tyrrrz/GitHubActionsTestLogger

Debug GITHUB_WORKSPACE value for Tyrrrz/GitHubActionsTestLogger #88

name: build and test .NET Core 8.0 Linux
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-linux
runs-on: ubuntu-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: wget https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.23.0/step-cli_0.23.0_amd64.deb && sudo dpkg -i step-cli_0.23.0_amd64.deb
- name: Pull step-ca Docker Image
run: docker pull smallstep/step-ca
- name: Install Test Report Tools
run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 && dotnet tool install --global LiquidTestReports.Cli --version 1.4.3-beta
- name: Install Dependencies & Build Certify.Core.Tests.Unit
run: dotnet add package GitHubActionsTestLogger && dotnet build -c Debug -f net8.0 --property WarningLevel=0 /clp:ErrorsOnly
working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit
- name: Run Certify.Core.Tests.Unit Tests
run: echo "GITHUB_WORKSPACE = $GITHUB_WORKSPACE" && dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true
working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0
# - name: Generated Test Results Report
# if: success() || failure() # run this step even if previous step failed
# run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md --title "Test Results" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > $GITHUB_STEP_SUMMARY
# uses: dorny/test-reporter@v1
# if: success() || failure() # run this step even if previous step failed
# with:
# name: Test Results # Name of the check run which will be created
# path: ./src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx # Path to test results
# reporter: dotnet-trx # Format of test results
# working-directory: ./certify
# max-annotations: '50'
- name: Generated Test Coverage Report
if: success() || failure() # run this step even if previous step failed
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 }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md > $GITHUB_STEP_SUMMARY
# - name: Publish Test Results
# uses: EnricoMi/publish-unit-test-result-action@v2
# if: always()
# with:
# files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx