Skip to content

Commit

Permalink
Net8 (#3)
Browse files Browse the repository at this point in the history
* net 8

* Fix Tests

* EnableWindowsTargeting=true

* Update versions

* update yml

* update build

* update project file

* fix test step and move before ql

* Remove .net 7

* update build

* remove framework build

* remove test checks

* create test workflow

* .

* Fix project file
  • Loading branch information
cwinland authored Jul 15, 2024
1 parent 40ca3a1 commit 849834b
Show file tree
Hide file tree
Showing 35 changed files with 257 additions and 1,542 deletions.
72 changes: 46 additions & 26 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,54 @@
name: Build and Test .NET Projects
name: CodeQL Analysis

on:
push:
branches:
- master # Adjust the branch name as needed
on: [pull_request]

jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
dotnet-version: ['6.x', '7.x', '8.x'] # Specify the desired versions

runs-on: ubuntu-latest
language: [ 'csharp' ]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

runs-on: ubuntu-latest

steps:
- 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
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}" # Set up .NET Core for each version

41 changes: 41 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Run Windows Tests

on: [push, pull_request]

jobs:

build:

strategy:
matrix:
language: [ 'csharp' ]
configuration: [Release]

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 # Replace with your solution name, i.e. MyWpfApp.sln.
Test_Project_Path: wpf-material-dialogs.test\wpf-material-dialogs.test.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.
Wap_Project_Directory: src # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package.
Wap_Project_Path: src\wpf-material-dialogs.csproj # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj.

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2

# Execute all unit tests in the solution
- name: Execute unit tests
run: dotnet test
121 changes: 63 additions & 58 deletions src/wpf-material-dialogs.csproj
Original file line number Diff line number Diff line change
@@ -1,64 +1,69 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFrameworks>net472;net6.0-windows;net7.0-windows</TargetFrameworks>
<AssemblyTitle>Material Design WPF Dialogs</AssemblyTitle>
<UseWindowsForms>true</UseWindowsForms>
<LangVersion>latest</LangVersion>
<UseWPF>true</UseWPF>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<NoWarn></NoWarn>
<PlatformTarget>x64</PlatformTarget>
<RunCodeAnalysis>false</RunCodeAnalysis>
<WarningsAsErrors>1591</WarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<WarningsAsErrors>1591</WarningsAsErrors>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<RootNamespace>wpf_material_dialogs</RootNamespace>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Authors>Christopher Winland</Authors>
<Company>Microsoft Corporation</Company>
<PackageProjectUrl>https://github.com/cwinland/wpf-material-dialogs</PackageProjectUrl>
<RepositoryUrl>https://github.com/cwinland/wpf-material-dialogs</RepositoryUrl>
<RepositoryType>GitHub</RepositoryType>
<PackageTags>WPF Dialogs Core Framework NET Custom Easy</PackageTags>
<PackageDescription>Common and customizable dialogs made easier in WPF using MaterialDesignThemes.</PackageDescription>
<Title>WPF Material Dialogs</Title>
</PropertyGroup>
<PropertyGroup>
<AssemblyVersion>1.$([System.DateTime]::Now.ToString("y.MM.ddHH"))</AssemblyVersion>
<FileVersion>1.$([System.DateTime]::Now.ToString("y.MM.ddHH"))</FileVersion>
<Version>2.$([System.DateTime]::Now.ToString("y.MM.ddHH"))</Version>
</PropertyGroup>
<PropertyGroup>
<GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);SetPackageVersion</GenerateNuspecDependsOn>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Description>Common and customizable dialogs made easier in WPF using MaterialDesignThemes.</Description>
<Copyright>copyright(c) 2021 Christopher Winland</Copyright>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net472|AnyCPU'">
<PlatformTarget>x64</PlatformTarget>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<Target Name="SetPackageVersion">
<PropertyGroup>
<PackageVersion>1.$([System.DateTime]::Now.ToString("y.MM.ddHH"))</PackageVersion>
<TargetFrameworks>net6.0-windows;net8.0-windows</TargetFrameworks>
<AssemblyTitle>Material Design WPF Dialogs</AssemblyTitle>
<UseWindowsForms>true</UseWindowsForms>
<LangVersion>latest</LangVersion>
<UseWPF>true</UseWPF>
<PlatformTarget>AnyCPU</PlatformTarget>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>
</Target>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<NoWarn></NoWarn>
<RunCodeAnalysis>false</RunCodeAnalysis>
<WarningsAsErrors>1591</WarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<WarningsAsErrors>1591</WarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<RootNamespace>wpf_material_dialogs</RootNamespace>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Authors>Christopher Winland</Authors>
<Company>Microsoft Corporation</Company>
<PackageProjectUrl>https://github.com/cwinland/wpf-material-dialogs</PackageProjectUrl>
<RepositoryUrl>https://github.com/cwinland/wpf-material-dialogs</RepositoryUrl>
<RepositoryType>GitHub</RepositoryType>
<PackageTags>WPF Dialogs Core Framework NET Custom Easy</PackageTags>
<PackageDescription>Common and customizable dialogs made easier in WPF using MaterialDesignThemes.</PackageDescription>
<Title>WPF Material Dialogs</Title>
</PropertyGroup>
<PropertyGroup>
<AssemblyVersion>1.$([System.DateTime]::Now.ToString("y.MM.ddHH"))</AssemblyVersion>
<FileVersion>1.$([System.DateTime]::Now.ToString("y.MM.ddHH"))</FileVersion>
<Version>2.$([System.DateTime]::Now.ToString("y.MM.ddHH"))</Version>
</PropertyGroup>
<PropertyGroup>
<GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);SetPackageVersion</GenerateNuspecDependsOn>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Description>Common and customizable dialogs made easier in WPF using MaterialDesignThemes.</Description>
<Copyright>copyright(c) 2021 Christopher Winland</Copyright>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net472|AnyCPU'">
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<Target Name="SetPackageVersion">
<PropertyGroup>
<PackageVersion>1.$([System.DateTime]::Now.ToString("y.MM.ddHH"))</PackageVersion>
</PropertyGroup>
</Target>

<ItemGroup>
<PackageReference Include="MaterialDesignColors" Version="2.0.3" />
<PackageReference Include="MaterialDesignThemes" Version="4.2.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MaterialDesignColors" Version="2.0.3" />
<PackageReference Include="MaterialDesignThemes" Version="4.2.1" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.*" PrivateAssets="Analyzers" />
</ItemGroup>

<ItemGroup>
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</Project>
10 changes: 2 additions & 8 deletions wpf-material-dialogs.sln
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31624.102
# Visual Studio Version 17
VisualStudioVersion = 17.8.34316.72
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "wpf-material-dialogs", "src\wpf-material-dialogs.csproj", "{DB04B9E7-952D-4F8A-8A9E-31C3D223DA2F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "wpf-material-dialogs.test", "wpf-material-dialogs.test\wpf-material-dialogs.test.csproj", "{46927F38-1C0F-40BB-88D5-E9FEF374356E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "wpf-material-wpfTest", "wpf-material-wpfTest\wpf-material-wpfTest.csproj", "{441E0B86-9D05-4A1C-BB12-6C966FF8F890}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wpf-material-wpftestFramework", "wpf-material-wpftestFramework\wpf-material-wpftestFramework.csproj", "{8183930B-C5AE-4C65-8721-DD9BE6B5D879}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -29,10 +27,6 @@ Global
{441E0B86-9D05-4A1C-BB12-6C966FF8F890}.Debug|Any CPU.Build.0 = Debug|Any CPU
{441E0B86-9D05-4A1C-BB12-6C966FF8F890}.Release|Any CPU.ActiveCfg = Release|Any CPU
{441E0B86-9D05-4A1C-BB12-6C966FF8F890}.Release|Any CPU.Build.0 = Release|Any CPU
{8183930B-C5AE-4C65-8721-DD9BE6B5D879}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8183930B-C5AE-4C65-8721-DD9BE6B5D879}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8183930B-C5AE-4C65-8721-DD9BE6B5D879}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8183930B-C5AE-4C65-8721-DD9BE6B5D879}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
19 changes: 19 additions & 0 deletions wpf-material-dialogs.test/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Runtime.InteropServices;
using Xunit;

// In SDK-style projects such as this one, several assembly attributes that were historically
// defined in this file are now automatically added during build and populated with
// values defined in project properties. For details of which attributes are included
// and how to customise this process see: https://aka.ms/assembly-info-properties


// Setting ComVisible to false makes the types in this assembly not visible to COM
// components. If you need to access a type in this assembly from COM, set the ComVisible
// attribute to true on that type.

[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM.

[assembly: Guid("f0c835b6-35db-4ced-971f-f9e97b0d13b7")]
[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly, DisableTestParallelization = true)]
Loading

0 comments on commit 849834b

Please sign in to comment.