Skip to content

Commit f87df69

Browse files
authored
split workflow (#127)
1 parent 85c9ba1 commit f87df69

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

.github/workflows/dotnet-desktop.yml .github/workflows/build-and-pack.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,11 @@
3636
# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications,
3737
# refer to https://github.com/microsoft/github-actions-for-desktop-apps
3838

39-
name: .NET Core Desktop
39+
name: .NET Core Desktop - Build and create package
4040

4141
on:
4242
push:
4343
branches: [ "root" ]
44-
pull_request:
45-
branches: [ "root" ]
4644

4745
jobs:
4846

.github/workflows/build.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: .NET Core Desktop - Build and test
2+
3+
on:
4+
pull_request:
5+
branches: [ "root" ]
6+
7+
jobs:
8+
9+
build:
10+
11+
strategy:
12+
matrix:
13+
configuration: [Release]
14+
15+
runs-on: windows-latest # For a list of available runner types, refer to
16+
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
17+
18+
env:
19+
Solution_Name: NeedABreak.sln # Replace with your solution name, i.e. MyWpfApp.sln.
20+
Test_Project_Path: NeedABreakTests\NeedABreakTests.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.
21+
Wap_Project_Directory: NeedABreakPackagingProject # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package.
22+
Wap_Project_Path: NeedABreakPackagingProject\NeedABreakPackagingProject.wapproj # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj.
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
30+
# Install the .NET Core workload
31+
- name: Install .NET Core
32+
uses: actions/setup-dotnet@v4
33+
with:
34+
dotnet-version: 8.0.x
35+
36+
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
37+
- name: Setup MSBuild.exe
38+
uses: microsoft/setup-msbuild@v2
39+
40+
# Execute all unit tests in the solution
41+
- name: Execute unit tests
42+
run: dotnet test $env:Test_Project_Path
43+
44+
# Restore the application to populate the obj folder with RuntimeIdentifiers
45+
- name: Restore the application
46+
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
47+
env:
48+
Configuration: ${{ matrix.configuration }}

0 commit comments

Comments
 (0)