Skip to content

workflow updated

workflow updated #2

Workflow file for this run

name: .NET Tests (collector)
on:
push: { branches: [ "main" ] }
pull_request: { branches: [ "main" ] }
workflow_dispatch: {} # ← enables the “Run workflow” button
jobs:
test:
runs-on: ubuntu-latest
strategy:

Check failure on line 12 in .github/workflows/dotnet-tests.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/dotnet-tests.yml

Invalid workflow file

You have an error in your yaml syntax on line 12
matrix:
include:
- name: UserManagementApi.Tests.Unit
proj: UserManagementApi.Tests.Unit.csproj
- name: UserManagementApi.Tests.Integration
proj: UserManagementApi.Tests.Integration.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 }}" \
--no-build \
--collect:"XPlat Code Coverage" \
--settings coverlet.runsettings.xml \
--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
# Codecov (optional)
- 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
permissions:
id-token: write