Skip to content

Commit

Permalink
Re-created a GitHub build & test pipeline
Browse files Browse the repository at this point in the history
* Updated UnitTests.csproj to use the latest MSTest.Adaptor/Framework nugets
* Use `dotnet test` to run the unit tests
  • Loading branch information
jstedfast committed Aug 29, 2024
1 parent 62e5480 commit 3171dfe
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build Managed

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
managed-build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.

- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x

- name: Setup MSBuild.exe
uses: microsoft/[email protected]

- name: Restore
run: nuget restore src\BehaviorsSdk.sln

- name: Build
run: msbuild src\BehaviorsSdk.sln /p:Configuration=Release /p:SignType=real

- name: Run Tests
run: dotnet test Test\UnitTests\UnitTests.csproj

- name: Pack Behaviors
if: success()
run: msbuild src\Microsoft.Xaml.Behaviors\Microsoft.Xaml.Behaviors.csproj /p:Configuration=Release -t:pack

- name: Upload NuGet Artifacts
if: success()
uses: actions/upload-artifact@v2
with:
path: src\Microsoft.Xaml.Behaviors\bin\Release\*.nupkg
5 changes: 3 additions & 2 deletions Test/UnitTests/UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
<AssemblyName>UnitTests</AssemblyName>
<RootNamespace>UnitTests</RootNamespace>
<SignAssembly>true</SignAssembly>
<DelaySign>true</DelaySign>
<AssemblyOriginatorKeyFile>..\UnitTests.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="MSTest.TestAdapter">
<Version>3.0.2</Version>
<Version>3.5.2</Version>
</PackageReference>
<PackageReference Include="MSTest.TestFramework">
<Version>3.0.2</Version>
<Version>3.5.2</Version>
</PackageReference>
</ItemGroup>

Expand Down

0 comments on commit 3171dfe

Please sign in to comment.