Files
actions/csharp-build/action.yml
renovate[bot] 642883d9f9 fix(github-action): update actions/upload-artifact to v4.6.2 (#84)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-24 15:46:33 +00:00

49 lines
1.3 KiB
YAML

---
# yaml-language-server: $schema=https://json.schemastore.org/github-action.json
name: C# Build
description: 'Builds and tests C# projects.'
author: 'Ismo Vuorinen'
branding:
icon: 'code'
color: 'blue'
inputs:
dotnet-version:
description: 'Version of .NET SDK to use.'
required: false
runs:
using: composite
steps:
- name: Detect .NET SDK Version
uses: ivuorinen/actions/dotnet-version-detect@main
with:
default-version: '7.0'
- name: Setup .NET SDK
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
with:
dotnet-version: '${{ steps.detect-dotnet-version.outputs.dotnet-version }}'
- name: Restore Dependencies
shell: bash
run: dotnet restore
- name: Build Solution
shell: bash
run: dotnet build --configuration Release --no-restore
- name: Run Tests
shell: bash
run: |
dotnet test --configuration Release --no-build --collect:"XPlat Code Coverage" --logger "trx;LogFileName=test-results.trx"
- name: Upload Test Results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: test-results
path: |
**/*.trx
**/TestResults/**/coverage.cobertura.xml