-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
26 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,34 @@ | ||
# For more information on GitHub Actions, refer to https://github.com/features/actions | ||
# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications, | ||
# refer to https://github.com/microsoft/github-actions-for-desktop-apps | ||
name: Build and Test .NET Projects | ||
|
||
name: .NET Core Desktop | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- master # Adjust the branch name as needed | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
build-and-test: | ||
strategy: | ||
matrix: | ||
configuration: [Release] | ||
dotnet-version: ['6.x', '7.x', '8.x'] # Specify the desired versions | ||
|
||
runs-on: windows-latest # For a list of available runner types, refer to | ||
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on | ||
|
||
env: | ||
Solution_Name: wpf-material-dialogs.sln | ||
Test_Project_Path: wpf-material-dialogs.test\wpf-material-dialogs.test.csproj | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Install the .NET Core workload | ||
- name: Install .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 7.0.x | ||
|
||
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild | ||
- name: Setup MSBuild.exe | ||
uses: microsoft/[email protected] | ||
|
||
# Execute all unit tests in the solution | ||
- name: Execute unit tests | ||
run: dotnet test | ||
|
||
# Restore the application to populate the obj folder with RuntimeIdentifiers | ||
- name: Restore the application | ||
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration | ||
env: | ||
Configuration: ${{ matrix.configuration }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
# Set up .NET Core for each version | ||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: ${{ matrix.dotnet-version }} | ||
|
||
# Restore and build the application | ||
- name: Restore and Build | ||
run: | | ||
dotnet restore | ||
dotnet build | ||
# Run tests using the existing restore | ||
- name: Run Tests | ||
run: dotnet test |