Skip to content

Update dotnet-desktop.yml #443

Update dotnet-desktop.yml

Update dotnet-desktop.yml #443

name: .NET Desktop
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
jobs:
Build:
runs-on: windows-latest
strategy:
matrix:
configuration: [
Release
]
solution: [
src/Skylark.sln,
src/Skylark.DNS.sln,
src/Skylark.Wing.sln,
src/Skylark.Uptime.sln,
src/Skylark.Standard.sln,
src/Skylark.Clipboard.sln,
demo/Skylark.Console.Demo/ConsoleDemoJs/ConsoleDemoJs.sln,
demo/Skylark.Console.Demo/ConsoleDemoCss/ConsoleDemoCss.sln,
demo/Skylark.Console.Demo/ConsoleDemoTax/ConsoleDemoTax.sln,
demo/Skylark.Console.Demo/ConsoleDemoUrl/ConsoleDemoUrl.sln,
demo/Skylark.Console.Demo/ConsoleDemoWeb/ConsoleDemoWeb.sln,
demo/Skylark.Console.Demo/ConsoleDemoXml/ConsoleDemoXml.sln,
demo/Skylark.Console.Demo/ConsoleDemoHash/ConsoleDemoHash.sln,
demo/Skylark.Console.Demo/ConsoleDemoWord/ConsoleDemoWord.sln,
demo/Skylark.Console.Demo/ConsoleDemoJson/ConsoleDemoJson.sln,
demo/Skylark.Console.Demo/ConsoleDemoHtml/ConsoleDemoHtml.sln,
demo/Skylark.Console.Demo/ConsoleDemoPing/ConsoleDemoPing.sln,
demo/Skylark.Console.Demo/ConsoleDemoPort/ConsoleDemoPort.sln,
demo/Skylark.Console.Demo/ConsoleDemoText/ConsoleDemoText.sln,
demo/Skylark.Console.Demo/ConsoleDemoTime/ConsoleDemoTime.sln,
demo/Skylark.Console.Demo/ConsoleDemoSpeed/ConsoleDemoSpeed.sln,
demo/Skylark.Console.Demo/ConsoleDemoColor/ConsoleDemoColor.sln,
demo/Skylark.Console.Demo/ConsoleDemoXhtml/ConsoleDemoXhtml.sln,
demo/Skylark.Console.Demo/ConsoleDemoHelper/ConsoleDemoHelper.sln,
demo/Skylark.Console.Demo/ConsoleDemoUnicode/ConsoleDemoUnicode.sln,
demo/Skylark.Console.Demo/ConsoleDemoLottery/ConsoleDemoLottery.sln,
demo/Skylark.Console.Demo/ConsoleDemoStorage/ConsoleDemoStorage.sln,
demo/Skylark.Console.Demo/ConsoleDemoPassword/ConsoleDemoPassword.sln,
demo/Skylark.Console.Demo/ConsoleDemoCryptology/ConsoleDemoCryptology.sln,
demo/Skylark.Console.Demo/ConsoleDemoTypography/ConsoleDemoTypography.sln,
demo/Skylark.Console.Demo/ConsoleDemoTemperature/ConsoleDemoTemperature.sln
]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# Install Visual Studio Build Tools with MSBuild
- name: Install Visual Studio Build Tools
run: |
choco install visualstudio2019buildtools --ignore-checksums -y
choco install visualstudio2019-workload-vctools --ignore-checksums -y
# Install .NET Core SDK
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x
dotnet-quality: preview
# Set up MSBuild from Visual Studio
- name: Setup MSBuild.exe
run: |
echo "Adding MSBuild to path"
echo "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin" >> $GITHUB_PATH
# Execute unit tests
- name: Execute Unit Tests
run: dotnet test ${{ matrix.solution }} -c ${{ matrix.configuration }} /nowarn:CS0067,CS0108,CS0109,CS0114,CS0169,CS0414,CS0649,CA1416,NU5104,NETSDK1138,SYSLIB0003
env:
NUGET_CONFIG_PATH: ./NuGet.Config
# Restore the Skylark project
- name: Restore Skylark
run: |
& "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe" "${{ matrix.solution }}" /t:Restore /p:Configuration=$env:Configuration
env:
NUGET_CONFIG_PATH: ./NuGet.Config
Configuration: ${{ matrix.configuration }}
# Build the Skylark project
- name: Build Skylark
run: |
& "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe" "${{ matrix.solution }}" /t:Build /p:Configuration=$env:Configuration
env:
NUGET_CONFIG_PATH: ./NuGet.Config
Configuration: ${{ matrix.configuration }}