@@ -15,52 +15,77 @@ jobs:
1515 - name : Checkout
1616 uses : actions/checkout@v4
1717
18+ # Setup .NET 9 runtime
1819 - name : Setup .NET 9
1920 uses : actions/setup-dotnet@v4
2021 with :
2122 dotnet-version : 9.0.x
2223
23- # Only install MAUI on Windows
24+ # MAUI is Windows-only, skip on Linux to avoid workload installation errors
2425 - name : Install MAUI workload (Windows)
2526 if : matrix.os == 'windows-latest'
2627 run : dotnet workload install maui
2728
28- # Install wasm-tools on both platforms
29+ # wasm-tools needed for web projects on all platforms
2930 - name : Install wasm-tools workload
3031 run : dotnet workload install wasm-tools
3132
32- - name : Restore
33+ # RESTORE: Windows restores everything, Linux only restores Web project
34+ # This prevents MAUI-tizen dependency errors on Linux runners
35+ - name : Restore (Windows - all projects)
36+ if : matrix.os == 'windows-latest'
3337 run : dotnet restore
3438
35- - name : Build
39+ - name : Restore (Linux - web only)
40+ if : matrix.os == 'ubuntu-latest'
41+ run : dotnet restore src/Trion.Web/Trion.Web.csproj
42+
43+ # BUILD: Split build steps by OS to avoid Desktop project compilation on Linux
44+ # Windows builds Desktop (MAUI) + Web, Linux builds Web only
45+ - name : Build (Windows - all projects)
46+ if : matrix.os == 'windows-latest'
3647 run : dotnet build -c Release --no-restore --warnaserror
3748
38- - name : Test
49+ - name : Build (Linux - web only)
50+ if : matrix.os == 'ubuntu-latest'
51+ run : dotnet build src/Trion.Web/Trion.Web.csproj -c Release --no-restore --warnaserror
52+
53+ # TEST: Run unit tests only on relevant projects per platform
54+ - name : Test (Windows - all)
55+ if : matrix.os == 'windows-latest'
3956 run : dotnet test -c Release --no-build --logger trx --collect:"XPlat Code Coverage"
4057
41- # Publish Desktop - Windows only
58+ - name : Test (Linux - web only)
59+ if : matrix.os == 'ubuntu-latest'
60+ run : dotnet test src/Trion.Web/Trion.Web.csproj -c Release --no-build --logger trx --collect:"XPlat Code Coverage"
61+
62+ # PUBLISH DESKTOP: Windows only - creates self-contained single-file exe
4263 - name : Publish desktop (Windows)
4364 if : matrix.os == 'windows-latest'
4465 run : dotnet publish src/Trion.Desktop/Trion.Desktop.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -o artifacts/desktop
4566
46- # Publish Web - Both platforms
67+ # PUBLISH WEB: Both platforms - portable web app deployment
4768 - name : Publish web (portable)
4869 run : dotnet publish src/Trion.Web/Trion.Web.csproj -c Release -o artifacts/web
4970
71+ # ARTIFACT UPLOADS
72+ # Upload test results from both platforms
5073 - name : Upload test results
5174 if : always()
5275 uses : actions/upload-artifact@v4
5376 with :
5477 name : test-results-${{ matrix.os }}
5578 path : ' **/*.trx'
5679
80+ # Upload code coverage to codecov (Linux only to avoid duplicates)
5781 - name : Upload coverage
5882 if : matrix.os == 'ubuntu-latest'
5983 uses : codecov/codecov-action@v4
6084 with :
6185 token : ${{ secrets.CODECOV_TOKEN }}
6286 files : ' **/coverage.cobertura.xml'
6387
88+ # Upload all build artifacts (desktop exe on Windows, web files on both)
6489 - name : Upload build artifacts
6590 uses : actions/upload-artifact@v4
6691 with :
0 commit comments