11name : Trion CI
2-
32on :
43 push :
54 branches : [ main, dev ]
@@ -12,49 +11,81 @@ jobs:
1211 strategy :
1312 matrix :
1413 os : [ubuntu-latest, windows-latest]
15-
1614 steps :
1715 - name : Checkout
1816 uses : actions/checkout@v4
1917
20- - name : Setup .NET 9
18+ # Setup .NET 9 runtime
19+ - name : Setup .NET 9
2120 uses : actions/setup-dotnet@v4
2221 with :
2322 dotnet-version : 9.0.x
2423
25- - name : Install .NET workloads
26- run : dotnet workload install aspire wasm-tools
24+ # MAUI is Windows-only, skip on Linux to avoid workload installation errors
25+ - name : Install MAUI workload (Windows)
26+ if : matrix.os == 'windows-latest'
27+ run : dotnet workload install maui
28+
29+ # wasm-tools needed for web projects on all platforms
30+ - name : Install wasm-tools workload
31+ run : dotnet workload install wasm-tools
2732
28- - 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'
2937 run : dotnet restore
3038
31- - 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'
3247 run : dotnet build -c Release --no-restore --warnaserror
3348
34- - 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'
3556 run : dotnet test -c Release --no-build --logger trx --collect:"XPlat Code Coverage"
3657
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
3763 - name : Publish desktop (Windows)
3864 if : matrix.os == 'windows-latest'
3965 run : dotnet publish src/Trion.Desktop/Trion.Desktop.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -o artifacts/desktop
4066
67+ # PUBLISH WEB: Both platforms - portable web app deployment
4168 - name : Publish web (portable)
4269 run : dotnet publish src/Trion.Web/Trion.Web.csproj -c Release -o artifacts/web
4370
71+ # ARTIFACT UPLOADS
72+ # Upload test results from both platforms
4473 - name : Upload test results
4574 if : always()
4675 uses : actions/upload-artifact@v4
4776 with :
4877 name : test-results-${{ matrix.os }}
4978 path : ' **/*.trx'
5079
80+ # Upload code coverage to codecov (Linux only to avoid duplicates)
5181 - name : Upload coverage
5282 if : matrix.os == 'ubuntu-latest'
5383 uses : codecov/codecov-action@v4
5484 with :
5585 token : ${{ secrets.CODECOV_TOKEN }}
5686 files : ' **/coverage.cobertura.xml'
5787
88+ # Upload all build artifacts (desktop exe on Windows, web files on both)
5889 - name : Upload build artifacts
5990 uses : actions/upload-artifact@v4
6091 with :
0 commit comments