@@ -26,28 +26,70 @@ jobs:
2626 version : ${{ env.BuildVersion }}.${{ github.run_number }}
2727 assemblyVersion : ${{ env.BuildVersion }}.${{ github.run_number }}
2828 fileVersion : ${{ env.BuildVersion }}.${{ github.run_number }}
29+
30+ - name : Setup .NET 3.1 (for unit tests only)
31+ uses : actions/setup-dotnet@v1
32+ with :
33+ dotnet-version : 3.1.x
34+
2935 - name : Setup .NET
3036 uses : actions/setup-dotnet@v1
3137 with :
3238 dotnet-version : 6.0.x
33- - name : Setup NuGet.exe
34- uses : nuget/setup-nuget@v1
35- - run : nuget restore ICSharpCode.AvalonEdit.sln
39+
40+ - name : Add msbuild to PATH
41+ 42+
43+ - run : msbuild ICSharpCode.AvalonEdit.sln /t:Restore /p:Configuration=${{ matrix.configuration }}
44+
3645 - name : Build
37- run : dotnet build ICSharpCode.AvalonEdit.sln --no-restore -c ${{ matrix.configuration }}
38- - name : Test
39- run : dotnet test ICSharpCode.AvalonEdit.sln --no-build --verbosity normal -c ${{ matrix.configuration }}
46+ run : msbuild ICSharpCode.AvalonEdit.sln /p:Configuration=${{ matrix.configuration }}
47+
48+ - name : Setup VSTest
49+ uses : Malcolmnixon/Setup-VSTest@v4
50+
51+ - name : net6.0-windows Unit Tests
52+ run : vstest.console $env:TestAssembly
53+ env :
54+ TestAssembly : ICSharpCode.AvalonEdit.Tests\bin\${{ matrix.configuration }}\net6.0-windows\ICSharpCode.AvalonEdit.Tests.dll
55+
56+ - name : netcoreapp3.1 Unit Tests
57+ run : vstest.console $env:TestAssembly
58+ env :
59+ TestAssembly : ICSharpCode.AvalonEdit.Tests\bin\${{ matrix.configuration }}\netcoreapp3.1\ICSharpCode.AvalonEdit.Tests.dll
60+
61+ - name : net45 Unit Tests
62+ run : vstest.console $env:TestAssembly
63+ env :
64+ TestAssembly : ICSharpCode.AvalonEdit.Tests\bin\${{ matrix.configuration }}\net45\ICSharpCode.AvalonEdit.Tests.dll
65+
66+ - name : net40 Unit Tests
67+ run : vstest.console $env:TestAssembly
68+ env :
69+ TestAssembly : ICSharpCode.AvalonEdit.Tests\bin\${{ matrix.configuration }}\net40\ICSharpCode.AvalonEdit.Tests.dll
70+
4071 - name : Style - tab check
4172 run : python BuildTools\tidy.py
73+
4274 - name : Pack
43- run : dotnet pack ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj -c ${{ matrix.configuration }}
75+ run : dotnet pack ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj -c ${{ matrix.configuration }}
76+
4477 - name : Upload NuGet
4578 if : matrix.configuration == 'release'
4679 uses : actions/upload-artifact@v2
4780 with :
4881 name : AvalonEdit NuGet Package (${{ matrix.configuration }})
4982 path : ICSharpCode.AvalonEdit/bin/Release/AvalonEdit*.nupkg
5083 if-no-files-found : error
84+
85+ - name : Upload Snupkg Artifact
86+ if : matrix.configuration == 'release'
87+ uses : actions/upload-artifact@v2
88+ with :
89+ name : AvalonEdit Snupkg (${{ matrix.configuration }})
90+ path : ICSharpCode.AvalonEdit/bin/Release/AvalonEdit*.snupkg
91+ if-no-files-found : error
92+
5193 - name : Publish NuGet
5294 if : github.ref == 'refs/heads/master' && matrix.configuration == 'release'
5395 run : |
0 commit comments