Skip to content

Combined dependency updates (2023-11-02) (#72) #176

Combined dependency updates (2023-11-02) (#72)

Combined dependency updates (2023-11-02) (#72) #176

Workflow file for this run

name: Test dotnet-test-split
on:
push:
branches-ignore:
- 'dependabot/**' #avoid duplicates: only run the PR, not the commit
tags-ignore:
- 'v*' #avoids rerun existing commit on release
pull_request:
branches:
- 'main'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
framework: ['netcoreapp3.1', 'net6.0']
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: '3.1.x'
- uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: '6.0.x'
- name: Generate mstest trx results from test assets
run: dotnet test --logger "trx;LogFileName=../../reports/mstest-report.trx" TestAssetsMstest/TestAssetsMstest.csproj || exit 0
- name: Generate nunit trx results from test assets
run: dotnet test --logger "trx;LogFileName=../../reports/nunit-report.trx" TestAssetsNunit/TestAssetsNunit.csproj || exit 0
- name: Generate xunit trx results from test assets
run: dotnet test --logger "trx;LogFileName=../../reports/xunit-report.trx" TestAssetsXunit/TestAssetsXunit.csproj || exit 0
- name: Split tests results
run: |
#dotnet build
#cd DotnetTestSplit/bin/Debug/netcoreapp3.1 && ls -la && ./DotnetTestSplit ../../../../reports/mstest-report.trx
dotnet new tool-manifest
dotnet pack DotnetTestSplit/DotnetTestSplit.csproj
#Note: to specify a target framework, tool must be installed as global, Then call is made by name instead of using dotnet tool run
dotnet tool install --global --framework ${{ matrix.framework }} --no-cache --add-source DotnetTestSplit/nupkg DotnetTestSplit
DotnetTestSplit reports/mstest-report.trx reports/mstest-report.trx.split
DotnetTestSplit reports/nunit-report.trx reports/nunit-report.trx.split
DotnetTestSplit reports/xunit-report.trx reports/xunit-report.trx.split
- name: Run test
run: dotnet test --framework ${{ matrix.framework }} --logger "trx;LogFileName=../../reports/dotnet-test-split-report.trx" TestDotnetTestSplit/TestDotnetTestSplit.csproj
#Shows error message in case of some failure (as test report checks are not always produced)
- name: Failure message if needed
if: failure()
run: echo "::error ::There was a build error or test failure, see the log and diff files in the test report artifacts"
#prevents execution on PR or dependabot that fails with "Resource not accessible by integration" due to permissions
- name: Publish test report
if: ${{ always() && github.actor=='javiertuya' }}
uses: dorny/test-reporter@v1
with:
name: test-report-${{ matrix.framework }}
path: reports/dotnet-test-split-report.trx
reporter: dotnet-trx
fail-on-error: 'true'
- name: Generate junit html reports
if: always()
run: ant report
- name: Publish test report files
if: always()
uses: actions/upload-artifact@v3
with:
name: test-report-files-${{ matrix.framework }}
path: |
expected
reports