Skip to content

Commit

Permalink
build desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
Kukks committed Nov 28, 2024
1 parent 1182ed7 commit d9ed601
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 56 deletions.
48 changes: 41 additions & 7 deletions .github/workflows/desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:

# https://blog.taranissoftware.com/build-net-maui-apps-with-github-actions
jobs:
build:
test-desktop:
runs-on: ubuntu-latest
steps:
# Setup code, .NET and Android
Expand All @@ -43,9 +43,43 @@ jobs:
sleep 10
done
# Run tests
- name: Run fast tests
run: dotnet test -v n --logger "console;verbosity=normal" --filter "Fast=Fast" BTCPayApp.Tests
- name: Run integration tests
run: dotnet test -v n --logger "console;verbosity=normal" --filter "Integration=Integration" BTCPayApp.Tests
- name: Run Selenium tests
run: dotnet test --filter "Selenium=Selenium" -v n --logger "console;verbosity=normal" BTCPayApp.Tests
- name: Run tests
run: dotnet test -v n --logger "console;verbosity=normal" BTCPayApp.Tests
# Stop infrastructure

build-windows:
runs-on: windows-latest
steps:
# Setup code, .NET and Android
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build win x64
run: dotnet publish BTCPayApp.Photino/BTCPayApp.Photino.csproj -f win-x64 -c Debug -o publish/win-x64
- name: Build win x86
run: dotnet publish BTCPayApp.Photino/BTCPayApp.Photino.csproj -f win-x86 -c Debug -o publish/win-x86
- name: Build win-arm64
run: dotnet publish BTCPayApp.Photino/BTCPayApp.Photino.csproj -f win-arm64 -c Debug -o publish/win-arm64
- name: Build linux x64
run: dotnet publish BTCPayApp.Photino/BTCPayApp.Photino.csproj -f linux-x64 -c Debug -o publish/linux-x64
- name: Build linux arm64
run: dotnet publish BTCPayApp.Photino/BTCPayApp.Photino.csproj -f linux-arm64 -c Debug -o publish/linux-arm64
- name: Upload artifact win
uses: actions/upload-artifact@v4
with:
name: windows build
path: |
publish/win-x64
publish/win-x86
publish/win-arm64
- name: Upload artifact linux
uses: actions/upload-artifact@v4
with:
name: windows build
path: |
publish/linux-x64
publish/linux-arm64
36 changes: 19 additions & 17 deletions BTCPayApp.Photino/BTCPayApp.Photino.csproj
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<OutputType>WinExe</OutputType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Version>1.0.0</Version>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<OutputType>WinExe</OutputType>
<SelfContained>true</SelfContained>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Version>1.0.0</Version>
<DebugType>embedded</DebugType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Photino.Blazor" Version="3.2.0" />
<PackageReference Include="Photino.Blazor" Version="3.2.0"/>
</ItemGroup>

<ItemGroup>
<Content Update="wwwroot\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BTCPayApp.Core\BTCPayApp.Core.csproj" />
<ProjectReference Include="..\BTCPayApp.Desktop\BTCPayApp.Desktop.csproj" />
<ProjectReference Include="..\BTCPayApp.UI\BTCPayApp.UI.csproj" />
<Content Update="wwwroot\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BTCPayApp.Core\BTCPayApp.Core.csproj"/>
<ProjectReference Include="..\BTCPayApp.Desktop\BTCPayApp.Desktop.csproj"/>
<ProjectReference Include="..\BTCPayApp.UI\BTCPayApp.UI.csproj"/>
</ItemGroup>


Expand Down
3 changes: 2 additions & 1 deletion BTCPayApp.Photino/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public static class Program
private static void Main(string[] args)
{
var builder = PhotinoBlazorAppBuilder.CreateDefault(args);

builder.Services.TryAddSingleton<IConfiguration>(_ =>
{
var configBuilder = new ConfigurationBuilder();
Expand All @@ -27,7 +28,7 @@ private static void Main(string[] args)
builder.Services.ConfigureBTCPayAppCore();
builder.Services.ConfigureBTCPayAppDesktop();
builder.Services.AddLogging();
builder.RootComponents.Add<App>("app");
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");

var app = builder.Build();
Expand Down
62 changes: 31 additions & 31 deletions BTCPayApp.Tests/UnitTest1.cs
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
using BTCPayApp.UI;
using BTCPayApp.UI.Pages;
using Xunit.Abstractions;

namespace BTCPayApp.Tests;

public class UnitTest1
{
private readonly ITestOutputHelper _testOutputHelper;

public UnitTest1(ITestOutputHelper testOutputHelper)
{
_testOutputHelper = testOutputHelper;
}

[Fact]
public async Task TestHomePage()
{
await using var factory = new BTCPayAppTestServer(_testOutputHelper);
var page = await (await factory.InitializeAsync()).NewPageAsync();
await page.GotoAsync(factory.ServerAddress);
Assert.EndsWith(Routes.Index, page.Url);

var carousel = page.Locator("#OnboardingCarousel");
await carousel.Locator("[aria-label='3']").ClickAsync();
Assert.True(await carousel.GetByTestId("StandaloneButton").IsDisabledAsync());

await carousel.GetByTestId("PairButton").ClickAsync();
Assert.EndsWith(Routes.Pair, page.Url);
}
}
// using BTCPayApp.UI;
// using BTCPayApp.UI.Pages;
// using Xunit.Abstractions;
//
// namespace BTCPayApp.Tests;
//
// public class UnitTest1
// {
// private readonly ITestOutputHelper _testOutputHelper;
//
// public UnitTest1(ITestOutputHelper testOutputHelper)
// {
// _testOutputHelper = testOutputHelper;
// }
//
// [Fact]
// public async Task TestHomePage()
// {
// await using var factory = new BTCPayAppTestServer(_testOutputHelper);
// var page = await (await factory.InitializeAsync()).NewPageAsync();
// await page.GotoAsync(factory.ServerAddress);
// Assert.EndsWith(Routes.Index, page.Url);
//
// var carousel = page.Locator("#OnboardingCarousel");
// await carousel.Locator("[aria-label='3']").ClickAsync();
// Assert.True(await carousel.GetByTestId("StandaloneButton").IsDisabledAsync());
//
// await carousel.GetByTestId("PairButton").ClickAsync();
// Assert.EndsWith(Routes.Pair, page.Url);
// }
// }

0 comments on commit d9ed601

Please sign in to comment.