Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 39 additions & 8 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Trion CI

on:
push:
branches: [ main, dev ]
Expand All @@ -12,49 +11,81 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET 9
# Setup .NET 9 runtime
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: Install .NET workloads
run: dotnet workload install aspire wasm-tools
# MAUI is Windows-only, skip on Linux to avoid workload installation errors
- name: Install MAUI workload (Windows)
if: matrix.os == 'windows-latest'
run: dotnet workload install maui

# wasm-tools needed for web projects on all platforms
- name: Install wasm-tools workload
run: dotnet workload install wasm-tools

- name: Restore
# RESTORE: Windows restores everything, Linux only restores Web project
# This prevents MAUI-tizen dependency errors on Linux runners
- name: Restore (Windows - all projects)
if: matrix.os == 'windows-latest'
run: dotnet restore

- name: Build
- name: Restore (Linux - web only)
if: matrix.os == 'ubuntu-latest'
run: dotnet restore src/Trion.Web/Trion.Web.csproj

# BUILD: Split build steps by OS to avoid Desktop project compilation on Linux
# Windows builds Desktop (MAUI) + Web, Linux builds Web only
- name: Build (Windows - all projects)
if: matrix.os == 'windows-latest'
run: dotnet build -c Release --no-restore --warnaserror

- name: Test
- name: Build (Linux - web only)
if: matrix.os == 'ubuntu-latest'
run: dotnet build src/Trion.Web/Trion.Web.csproj -c Release --no-restore --warnaserror

# TEST: Run unit tests only on relevant projects per platform
- name: Test (Windows - all)
if: matrix.os == 'windows-latest'
run: dotnet test -c Release --no-build --logger trx --collect:"XPlat Code Coverage"

- name: Test (Linux - web only)
if: matrix.os == 'ubuntu-latest'
run: dotnet test src/Trion.Web/Trion.Web.csproj -c Release --no-build --logger trx --collect:"XPlat Code Coverage"

# PUBLISH DESKTOP: Windows only - creates self-contained single-file exe
- name: Publish desktop (Windows)
if: matrix.os == 'windows-latest'
run: dotnet publish src/Trion.Desktop/Trion.Desktop.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -o artifacts/desktop

# PUBLISH WEB: Both platforms - portable web app deployment
- name: Publish web (portable)
run: dotnet publish src/Trion.Web/Trion.Web.csproj -c Release -o artifacts/web

# ARTIFACT UPLOADS
# Upload test results from both platforms
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}
path: '**/*.trx'

# Upload code coverage to codecov (Linux only to avoid duplicates)
- name: Upload coverage
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: '**/coverage.cobertura.xml'

# Upload all build artifacts (desktop exe on Windows, web files on both)
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
29 changes: 15 additions & 14 deletions Trion.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trion.Core", "src\Trion.Cor
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trion.Web", "src\Trion.Web\Trion.Web.csproj", "{C99FA784-527A-433A-8892-71A951DF63CE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trion.Desktop", "src\Trion.Desktop\Trion.Desktop.csproj", "{8976C35D-279D-4B29-B769-C72BA79201DD}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trion.Desktop", "src\Trion.Desktop\Trion.Desktop.csproj", "{75DB2555-FFE9-459B-B0E6-092D892FBE85}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -89,18 +89,19 @@ Global
{C99FA784-527A-433A-8892-71A951DF63CE}.Release|x64.Build.0 = Release|Any CPU
{C99FA784-527A-433A-8892-71A951DF63CE}.Release|x86.ActiveCfg = Release|Any CPU
{C99FA784-527A-433A-8892-71A951DF63CE}.Release|x86.Build.0 = Release|Any CPU
{8976C35D-279D-4B29-B769-C72BA79201DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8976C35D-279D-4B29-B769-C72BA79201DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8976C35D-279D-4B29-B769-C72BA79201DD}.Debug|x64.ActiveCfg = Debug|Any CPU
{8976C35D-279D-4B29-B769-C72BA79201DD}.Debug|x64.Build.0 = Debug|Any CPU
{8976C35D-279D-4B29-B769-C72BA79201DD}.Debug|x86.ActiveCfg = Debug|Any CPU
{8976C35D-279D-4B29-B769-C72BA79201DD}.Debug|x86.Build.0 = Debug|Any CPU
{8976C35D-279D-4B29-B769-C72BA79201DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8976C35D-279D-4B29-B769-C72BA79201DD}.Release|Any CPU.Build.0 = Release|Any CPU
{8976C35D-279D-4B29-B769-C72BA79201DD}.Release|x64.ActiveCfg = Release|Any CPU
{8976C35D-279D-4B29-B769-C72BA79201DD}.Release|x64.Build.0 = Release|Any CPU
{8976C35D-279D-4B29-B769-C72BA79201DD}.Release|x86.ActiveCfg = Release|Any CPU
{8976C35D-279D-4B29-B769-C72BA79201DD}.Release|x86.Build.0 = Release|Any CPU
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Debug|x64.ActiveCfg = Debug|Any CPU
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Debug|x64.Build.0 = Debug|Any CPU
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Debug|x86.ActiveCfg = Debug|Any CPU
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Debug|x86.Build.0 = Debug|Any CPU
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Release|Any CPU.Build.0 = Release|Any CPU
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Release|x64.ActiveCfg = Release|Any CPU
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Release|x64.Build.0 = Release|Any CPU
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Release|x86.ActiveCfg = Release|Any CPU
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -111,7 +112,7 @@ Global
{8F4FA8F8-6064-41DC-B0B8-4394373EBC83} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{7489FB6C-F47B-4178-B5DD-20D8F4608728} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{C99FA784-527A-433A-8892-71A951DF63CE} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{8976C35D-279D-4B29-B769-C72BA79201DD} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{75DB2555-FFE9-459B-B0E6-092D892FBE85} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {11752BB0-7828-4D57-81A5-144236B2A82F}
Expand Down
17 changes: 17 additions & 0 deletions src/Trion.Desktop/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Trion.Desktop"
x:Class="Trion.Desktop.App">
<Application.Resources>
<ResourceDictionary>

<!--
For information about styling .NET MAUI pages
please refer to the documentation:
https://go.microsoft.com/fwlink/?linkid=2282329
-->

</ResourceDictionary>
</Application.Resources>
</Application>
15 changes: 15 additions & 0 deletions src/Trion.Desktop/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace Trion.Desktop
{
public partial class App : Application
{
public App()
{
InitializeComponent();
}

protected override Window CreateWindow(IActivationState? activationState)
{
return new Window(new MainPage()) { Title = "Trion.Desktop" };
}
}
}
20 changes: 0 additions & 20 deletions src/Trion.Desktop/Components/Appli.razor

This file was deleted.

34 changes: 16 additions & 18 deletions src/Trion.Desktop/Components/Layout/MainLayout.razor
Original file line number Diff line number Diff line change
@@ -1,37 +1,32 @@
@inherits LayoutComponentBase

<MudThemeProvider Theme="@_theme" IsDarkMode="@_isDarkMode" />
<MudThemeProvider Theme="@_theme" IsDarkMode="_isDarkMode" />
<MudPopoverProvider />
<MudDialogProvider />
<MudSnackbarProvider />

<MudLayout>
<MudAppBar Elevation="1">
<MudIconButton Icon="@Icons.Material.Filled.Menu"
Color="Color.Inherit"
Edge="Edge.Start"
OnClick="@DrawerToggle" />
<MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="@((e) => DrawerToggle())" />
<MudText Typo="Typo.h5" Class="ml-3">Application</MudText>
<MudSpacer />
<MudIconButton Icon="@DarkLightModeButtonIcon"
Color="Color.Inherit"
OnClick="@DarkModeToggle" />
<MudIconButton Icon="@Icons.Material.Filled.MoreVert"
Color="Color.Inherit"
Edge="Edge.End" />
<MudIconButton Icon="@(DarkLightModeButtonIcon)" Color="Color.Inherit" OnClick="@DarkModeToggle" />
<MudIconButton Icon="@Icons.Material.Filled.MoreVert" Color="Color.Inherit" Edge="Edge.End" />
</MudAppBar>

<MudDrawer @bind-Open="_drawerOpen"
ClipMode="DrawerClipMode.Always"
Elevation="2">
<MudDrawer id="nav-drawer" @bind-Open="_drawerOpen" ClipMode="DrawerClipMode.Always" Elevation="2">
<NavMenu />
</MudDrawer>

<MudMainContent Class="pt-16 pa-4">
@Body
</MudMainContent>
</MudLayout>


<div id="blazor-error-ui" data-nosnippet>
An unhandled error has occurred.
<a href="." class="reload">Reload</a>
<span class="dismiss">🗙</span>
</div>

@code {
private bool _drawerOpen = true;
private bool _isDarkMode = true;
Expand All @@ -40,6 +35,7 @@
protected override void OnInitialized()
{
base.OnInitialized();

_theme = new()
{
PaletteLight = _lightPalette,
Expand Down Expand Up @@ -102,4 +98,6 @@
true => Icons.Material.Rounded.AutoMode,
false => Icons.Material.Outlined.DarkMode,
};
}
}


51 changes: 15 additions & 36 deletions src/Trion.Desktop/Components/Layout/MainLayout.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ main {
text-decoration: none;
}

.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
text-decoration: underline;
}
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
text-decoration: underline;
}

.top-row ::deep a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}
.top-row ::deep a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}

@media (max-width: 640.98px) {
.top-row {
justify-content: space-between;
}

.top-row ::deep a, .top-row ::deep .btn-link {
margin-left: 0;
}
.top-row ::deep a, .top-row ::deep .btn-link {
margin-left: 0;
}
}

@media (min-width: 641px) {
Expand All @@ -64,35 +64,14 @@ main {
z-index: 1;
}

.top-row.auth ::deep a:first-child {
flex: 1;
text-align: right;
width: 0;
}
.top-row.auth ::deep a:first-child {
flex: 1;
text-align: right;
width: 0;
}

.top-row, article {
padding-left: 2rem !important;
padding-right: 1.5rem !important;
}
}

#blazor-error-ui {
color-scheme: light only;
background: lightyellow;
bottom: 0;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
box-sizing: border-box;
display: none;
left: 0;
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
position: fixed;
width: 100%;
z-index: 1000;
}

#blazor-error-ui .dismiss {
cursor: pointer;
position: absolute;
right: 0.75rem;
top: 0.5rem;
}
32 changes: 27 additions & 5 deletions src/Trion.Desktop/Components/Layout/NavMenu.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
<MudNavMenu>
<MudNavLink Href="/" Match="NavLinkMatch.All" Icon="@Icons.Material.Filled.Home">Home</MudNavLink>
<MudNavLink Href="/counter" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Add">Counter</MudNavLink>
<MudNavLink Href="/weather" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.List">Weather</MudNavLink>
</MudNavMenu>
<div class="top-row ps-3 navbar navbar-dark">
<div class="container-fluid">
<a class="navbar-brand" href="">Trion.Desktop</a>
</div>
</div>

<input type="checkbox" title="Navigation menu" class="navbar-toggler" />

<div class="nav-scrollable" onclick="document.querySelector('.navbar-toggler').click()">
<nav class="flex-column">
<div class="nav-item px-3">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<span class="bi bi-house-door-fill-nav-menu" aria-hidden="true"></span> Home
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="counter">
<span class="bi bi-plus-square-fill-nav-menu" aria-hidden="true"></span> Counter
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="weather">
<span class="bi bi-list-nested-nav-menu" aria-hidden="true"></span> Weather
</NavLink>
</div>
</nav>
</div>
Loading
Loading