Skip to content

Merge branch 'phase-5-webapp' #21

Merge branch 'phase-5-webapp'

Merge branch 'phase-5-webapp' #21

Workflow file for this run

name: .NET Tests (collector)
on:
push:
branches: [ "main", "master" ]
paths-ignore:
- "**/*.md"
- "**/*.png"
- "**/*.jpg"
- "**/*.svg"
pull_request:
branches: [ "main", "master" ]
workflow_dispatch: {}
jobs:
test:
runs-on: ubuntu-latest
permissions:
id-token: write # for Codecov OIDC (safe to keep)
strategy:
matrix:
include:
- name: UserManagementApi.Tests.Unit
proj: UserManagementApi.Tests.Unit/UserManagementApi.Tests.Unit.csproj
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Sanity - show files at repo root
run: ls -la
- name: Restore
run: dotnet restore
- name: Build (Release)
run: dotnet build --configuration Release --no-restore
- name: Test with coverage (collector → LCOV)
run: |
dotnet test "${{ matrix.proj }}" \
--configuration Release \
--no-build \
--collect:"XPlat Code Coverage" \
--settings coverlet.runsettings \
--results-directory "./TestResults/${{ matrix.name }}" \
--logger "trx;LogFileName=${{ matrix.name }}.trx" \
-v n
- name: Upload coverage + TRX
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}-results
path: |
TestResults/${{ matrix.name }}/**/coverage.info
TestResults/${{ matrix.name }}/**/*.trx
- name: Upload to Codecov
if: success()
uses: codecov/codecov-action@v5
with:
files: TestResults/${{ matrix.name }}/**/coverage.info
flags: ${{ matrix.name }}
fail_ci_if_error: true
use_oidc: true