Skip to content

Commit 05aa8a3

Browse files
authored
WIP (#2410)
* WIP * Adding solution to GH action * More cleanup of the GH Action * Adding TFM * Fixing ignored test due to duplicate data * Don't always upload More logging on tests * Include net core 3.1 * Properly mark test as success * Adding nightly release action * Properly naming actions * Setting nightly as PR * Enabling nuget.org push
1 parent 73b0d67 commit 05aa8a3

File tree

7 files changed

+128
-41
lines changed

7 files changed

+128
-41
lines changed

.github/workflows/dotnet.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/nightly_release.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Nightly Release
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 9 * * *'
7+
8+
env:
9+
solution: MaterialDesignToolkit.Full.sln
10+
buildPlatform: 'Any CPU'
11+
buildConfiguration: 'Release'
12+
mdixColorsVersion: '2.0.2'
13+
mdixMahAppsVersion: '0.1.8'
14+
mdixVersion: '4.2.0'
15+
16+
jobs:
17+
build:
18+
19+
runs-on: windows-latest
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Setup .NET Core 3.1
25+
uses: actions/setup-dotnet@v1
26+
with:
27+
dotnet-version: "3.1.x"
28+
env:
29+
NUGET_AUTH_TOKEN: ${{secrets.PAT}}
30+
31+
- name: Setup .NET
32+
uses: actions/setup-dotnet@v1
33+
with:
34+
dotnet-version: "5.0.x"
35+
env:
36+
NUGET_AUTH_TOKEN: ${{secrets.PAT}}
37+
38+
- name: Restore dependencies
39+
run: dotnet restore ${{ env.solution }}
40+
41+
- name: Build
42+
run: dotnet build ${{ env.solution }} --configuration ${{ env.buildConfiguration }} --no-restore -p:Platform="${{ env.buildPlatform }}" -p:MDIXVersion=${{ env.mdixVersion }}.${{ github.run_number }} -p:MDIXColorsVersion=${{ env.mdixColorsVersion }}.${{ github.run_number }} -p:MDIXMahAppsVersion=${{ env.mdixMahappsVersion }}.${{ github.run_number }} -p:TreatWarningsAsErrors=True
43+
44+
#- name: Test
45+
# run: dotnet test ${{ env.solution }} --configuration ${{ env.buildConfiguration }} --no-build --verbosity detailed --blame-crash
46+
47+
#- name: Upload Screenshots
48+
# if: ${{ always() }}
49+
# uses: actions/upload-artifact@v2
50+
# with:
51+
# name: Screenshots-${{ github.run_number }}
52+
# path: ${{ github.workspace }}/MaterialDesignThemes.UITests/bin/${{ env.buildConfiguration }}/net5.0-windows/Screenshots
53+
54+
- name: Build NuGets
55+
run: .\Scripts\BuildNugets.ps1 -MDIXVersion ${{ env.mdixVersion }}-ci${{ github.run_number }} -MDIXMahAppsVersion ${{ env.mdixMahappsVersion }}-ci${{ github.run_number }} -MDIXColorsVersion ${{ env.mdixColorsVersion }}-ci${{ github.run_number }}
56+
57+
- name: Upload NuGets
58+
uses: actions/upload-artifact@v2
59+
with:
60+
name: NuGets-${{ github.run_number }}
61+
path: "*.nupkg"
62+
63+
- name: Upload Demo App
64+
uses: actions/upload-artifact@v2
65+
with:
66+
name: DemoApp-${{ github.run_number }}
67+
path: "MainDemo.Wpf/bin/${{ env.buildConfiguration }}"
68+
69+
- name: Publish to NuGet.org
70+
run: dotnet nuget push ${{ github.workspace }}\*.nupkg --source https://api.nuget.org/v3/index.json -k ${{ secrets.PAT }} --skip-duplicate

.github/workflows/pr_verification.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Pull Request Verification
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
env:
8+
solution: MaterialDesignToolkit.Full.sln
9+
buildPlatform: 'Any CPU'
10+
buildConfiguration: 'Release'
11+
12+
jobs:
13+
build:
14+
15+
runs-on: windows-latest
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Setup .NET Core 3.1
21+
uses: actions/setup-dotnet@v1
22+
with:
23+
dotnet-version: "3.1.x"
24+
env:
25+
NUGET_AUTH_TOKEN: ${{secrets.PAT}}
26+
27+
- name: Setup .NET
28+
uses: actions/setup-dotnet@v1
29+
with:
30+
dotnet-version: "5.0.x"
31+
env:
32+
NUGET_AUTH_TOKEN: ${{secrets.PAT}}
33+
34+
- name: Restore dependencies
35+
run: dotnet restore ${{ env.solution }}
36+
37+
- name: Build
38+
run: dotnet build ${{ env.solution }} --configuration ${{ env.buildConfiguration }} --no-restore -p:Platform="${{ env.buildPlatform }}" -p:TreatWarningsAsErrors=True
39+
40+
- name: Test
41+
run: dotnet test ${{ env.solution }} --configuration ${{ env.buildConfiguration }} --no-build --verbosity detailed --blame-crash
42+
43+
- name: Upload Screenshots
44+
if: ${{ always() }}
45+
uses: actions/upload-artifact@v2
46+
with:
47+
name: Screenshots-${{ github.run_number }}
48+
path: ${{ github.workspace }}/MaterialDesignThemes.UITests/bin/${{ env.buildConfiguration }}/net5.0-windows/Screenshots

MaterialDesignColors.Wpf.Tests/MaterialDesignColors.Wpf.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFrameworks>net472;net5.0-windows</TargetFrameworks>
4+
<TargetFrameworks>net472;netcoreapp3.1;net5.0-windows</TargetFrameworks>
55
<AssemblyTitle>MaterialDesignColors.Wpf.Tests</AssemblyTitle>
66
<Product>MaterialDesignColors.Wpf.Tests</Product>
77
</PropertyGroup>

MaterialDesignThemes.UITests/WPF/DialogHosts/DialogHostTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ public async Task OnOpenDialog_OverlayCoversContent()
4545
await Wait.For(async () => await overlay.GetVisibility() != Visibility.Visible, retry);
4646
await testOverlayButton.LeftClick();
4747
await Wait.For(async () => Assert.Equal("Clicks: 2", await resultTextBlock.GetText()), retry);
48+
49+
recorder.Success();
4850
}
4951

5052
[Fact]

MaterialDesignThemes.Wpf.Tests/SnackbarMessageQueueTests.cs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,11 @@ public void GetSnackbarMessageDiscardDuplicatesQueue()
5353
Assert.Equal("Action content", messages[1].ActionContent);
5454
}
5555

56-
private class SnackbarMessageQueueSimpleTestData : IEnumerable<object[]>
57-
{
58-
public IEnumerator<object[]> GetEnumerator()
59-
{
60-
yield return new object[] { "String & Action content", "Action content" };
61-
yield return new object[] { "Different String & Action content", "Action content" };
62-
yield return new object[] { "Different String & Action content", "Action content" };
63-
yield return new object[] { "", "" };
64-
}
65-
66-
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
67-
}
68-
6956
[StaTheory]
70-
[ClassData(typeof(SnackbarMessageQueueSimpleTestData))]
7157
[Description("Ensures that GetSnackbaMessage behaves correctly if the queue simply outputs items")]
58+
[InlineData("String & Action content", "Action content")]
59+
[InlineData("Different String & Action content", "Action content")]
60+
[InlineData("", "")]
7261
public void GetSnackbarMessageSimpleQueue(object content, object actionContent)
7362
{
7463
_snackbarMessageQueue.DiscardDuplicates = false;

MaterialDesignToolkit.Full.sln

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.29021.104
@@ -34,9 +34,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
3434
Directory.Build.props = Directory.Build.props
3535
Directory.packages.props = Directory.packages.props
3636
global.json = global.json
37+
.github\workflows\icon_update.yml = .github\workflows\icon_update.yml
3738
MaterialDesignColors.nuspec = MaterialDesignColors.nuspec
3839
MaterialDesignThemes.MahApps.nuspec = MaterialDesignThemes.MahApps.nuspec
3940
MaterialDesignThemes.nuspec = MaterialDesignThemes.nuspec
41+
.github\workflows\nightly_release.yml = .github\workflows\nightly_release.yml
42+
.github\workflows\pr_verification.yml = .github\workflows\pr_verification.yml
4043
EndProjectSection
4144
EndProject
4245
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MaterialDesignThemes.UITests", "MaterialDesignThemes.UITests\MaterialDesignThemes.UITests.csproj", "{594D2254-3623-4088-A8BD-D74B6E96DE9F}"

0 commit comments

Comments
 (0)