Skip to content

.NET

.NET #10

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule: # Runs once a week
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --collect:"XPlat Code Coverage"
--logger:"console;verbosity=detailed" --results-directory /tmp/test-results/
# Move the coverage file from the dynamic GUID folder to a static
# location.
- name: Move test results
run: mv /tmp/test-results/*/coverage.cobertura.xml coverage.xml
- name: Report test coverage to DeepSource
uses: deepsourcelabs/test-coverage-action@master
with:
key: csharp
coverage-file: coverage.xml
dsn: ${{ secrets.DEEPSOURCE_DSN }}