-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (46 loc) · 1.53 KB
/
dotnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# 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
steps:
- uses: actions/checkout@v3
# Setup .NET
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.x
# Restore dependencies
- name: Restore dependencies
run: dotnet restore
# Build the project
- name: Build
run: dotnet build --no-restore
# Run tests with verbosity, no build, and capture any outputs
- name: Test
run: dotnet test --no-build --verbosity normal --no-restore > /dev/null 2>&1
timeout-minutes: 5
# Add sleep for investigation before cleanup (optional debugging step)
- name: Sleep for Investigation (5s)
run: sleep 5
# Debug logs: Check for processes and running tasks
- name: Debug Log (Before Cleanup)
run: |
echo "Test step finished. Checking for processes..."
tasklist /FI "IMAGENAME eq vstest.console.exe"
tasklist /FI "IMAGENAME eq dotnet.exe"
# Cleanup processes (kill vstest and dotnet if hanging)
- name: Cleanup Processes
run: |
echo "Cleaning up"
taskkill /F /IM vstest.console.exe || true
taskkill /F /IM dotnet.exe || true
# Force exit the workflow (forcing it to stop after cleanup)
- name: Exit Workflow (Force)
run: exit 0