Skip to content

Commit 9a2961c

Browse files
authored
Create build-samples.yml
1 parent 480d992 commit 9a2961c

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/build-samples.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Sample Build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
11+
build:
12+
13+
strategy:
14+
matrix:
15+
configuration: [Debug, Release]
16+
17+
runs-on: windows-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 0
24+
25+
# Install the .NET Core workload
26+
- name: Install .NET Core 3.x
27+
uses: actions/setup-dotnet@v1
28+
with:
29+
dotnet-version: 3.x
30+
31+
- name: Install .NET 5.x
32+
uses: actions/setup-dotnet@v1
33+
with:
34+
dotnet-version: 5.x
35+
36+
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
37+
- name: Setup MSBuild.exe
38+
uses: microsoft/[email protected]
39+
40+
- name: Restore/Build the sample
41+
run: msbuild LoginApp.sln /t:restore,build /p:Configuration=$env:Configuration
42+
working-directory: Sample
43+
env:
44+
Configuration: ${{ matrix.configuration }}
45+
46+
# Execute all unit tests in the solution
47+
- name: Execute unit tests
48+
working-directory: Sample
49+
run: dotnet test LoginApp.sln
50+

0 commit comments

Comments
 (0)