Skip to content

Commit ffb4c65

Browse files
authored
Update WindowsAction.yml
1 parent 9a7621e commit ffb4c65

File tree

1 file changed

+27
-21
lines changed

1 file changed

+27
-21
lines changed
Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,34 @@
1-
# This workflow will build a .NET project
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3-
4-
name: Windows Build
5-
61
on:
72
push:
8-
branches: [ "master" ]
9-
pull_request:
10-
branches: [ "master" ]
11-
3+
branches:
4+
- master
5+
env:
6+
solution: '**/*.sln'
7+
buildPlatform: Any CPU
8+
buildConfiguration: Release
129
jobs:
1310
build:
14-
15-
runs-on: windows-latest
16-
11+
runs-on: windows-2022
1712
steps:
18-
- uses: actions/checkout@v3
19-
- name: Setup .NET
20-
uses: actions/setup-dotnet@v3
13+
- uses: actions/checkout@v2
14+
- uses: microsoft/setup-msbuild@v1.0.2
15+
- name: Use dotnet 6
16+
uses: actions/setup-dotnet@v1
2117
with:
2218
dotnet-version: 6.0.x
23-
- name: Restore dependencies
24-
run: dotnet restore
25-
- name: Build
26-
run: dotnet build --no-restore
27-
- name: Test
28-
run: dotnet test --no-build --verbosity normal
19+
- uses: nuget/setup-nuget@v1
20+
- run: nuget restore ${{ env.solution }}
21+
- run: msbuild '${{ env.solution }}' /p:configuration='${{ env.buildConfiguration }}' /p:platform='${{ env.buildPlatform }}'
22+
- run: |
23+
$vsTestConsoleExe = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\TestPlatform\vstest.console.exe"
24+
$targetTestDll = "**\*test.dll
25+
!**\*TestAdapter.dll
26+
!**\obj\**
27+
"
28+
$testRunSettings = "/Settings:`"`" "
29+
#Note that the `" is an escape character to quote strings, and the `& is needed to start the command
30+
$command = "`& `"$vsTestConsoleExe`" `"$targetTestDll`" $testRunSettings $parameters "
31+
Write-Host "$command"
32+
Invoke-Expression $command
33+
shell: powershell
34+

0 commit comments

Comments
 (0)