Skip to content

Update dotnet.yml

Update dotnet.yml #809

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: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: windows-latest
timeout-minutes: 30 # Increased timeout for the entire job
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
# Run tests in parts (if categorized)
- name: Run Tests (Part 1)
run: dotnet test --no-build --verbosity normal --filter "Category=Part1" --no-restore
timeout-minutes: 5
- name: Run Tests (Part 2)
run: dotnet test --no-build --verbosity normal --filter "Category=Part2" --no-restore
timeout-minutes: 5
# Detailed logging for debugging
- name: Test with Detailed Logging
run: dotnet test --no-build --verbosity detailed --no-restore > result.log; tail -n 20 result.log
# Check for stuck processes if needed
- name: Check for Stuck Processes
run: tasklist /FI "IMAGENAME eq vstest.console.exe"
# Cleanup to force the workflow to exit in case of long waits
- name: Cleanup Processes
run: |
echo "Checking for stuck processes"
taskkill /IM vstest.console.exe /F || echo "No processes to kill"
timeout /T 10 /NOBREAK
- name: Exit Workflow (Force)
run: exit 0