Skip to content

Update README to reflect recently completed features and enhancements #153

Update README to reflect recently completed features and enhancements

Update README to reflect recently completed features and enhancements #153

name: .NET Test Runner
on:
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
DOTNET_VERSION: '10.x'
ARTIFACT_RETENTION_DAYS: '1'
TERM: xterm
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
prepare:
name: Prepare matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
cache: true
cache-dependency-path: |
**/*.csproj
**/packages.lock.json
**/nuget.config
**/Directory.Packages.props
- name: Restore (prepare)
run: dotnet restore --ignore-failed-sources
working-directory: .
continue-on-error: true
- id: set-matrix
name: Discover test projects via test-tools
shell: bash
run: |
set -euo pipefail
MATRIX_JSON=$(dotnet tools/test-tools.cs "$GITHUB_WORKSPACE" \
--format GitHubMatrix \
--workspaceRoot "$GITHUB_WORKSPACE")
echo "matrix<<EOF" >> "$GITHUB_OUTPUT"
echo "$MATRIX_JSON" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
test:
name: Test (${{ matrix.friendlyName }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
needs: prepare
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
cache: true
cache-dependency-path: |
**/*.csproj
**/packages.lock.json
**/nuget.config
**/Directory.Packages.props
- name: Restore dependencies
run: dotnet restore
working-directory: ${{ matrix.projectDir }}
- name: Run tests for ${{ matrix.friendlyName }}
working-directory: ${{ matrix.projectDir }}
run: |
dotnet test \
--configuration Release \
--logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" \
--collect:"XPlat Code Coverage" \
--results-directory ./coverage \
-- \
RunConfiguration.CollectSourceInformation=true \
DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ${{ matrix.projectDir }}/coverage
files: '**/*.xml'
fail_ci_if_error: false
verbose: true