Skip to content

Commit 41dbd04

Browse files
committed
Fix MAUI workload installation for Linux runners
- Skip MAUI workload on Linux in basic CI (not supported) - Use specific workloads: android, ios, maccatalyst instead of 'maui' - Linux builds focus on core .NET components and unit tests only - Android/iOS platform builds only on supported OS (Windows/macOS) - Remove Android SDK setup from Linux basic CI This should resolve the Linux workload installation failures.
1 parent 0b5a35f commit 41dbd04

File tree

3 files changed

+17
-19
lines changed

3 files changed

+17
-19
lines changed

.github/workflows/ci-build-and-test.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,17 @@ jobs:
4040
global-json-file: global.json
4141

4242
- name: Setup Java (for Android builds)
43-
if: matrix.os != 'macos-latest' # Skip Java on macOS for now to keep it simple
43+
if: matrix.os != 'ubuntu-latest' # Only install Java on Windows/macOS where we build Android
4444
uses: actions/setup-java@v4
4545
with:
4646
distribution: 'microsoft'
4747
java-version: '17'
4848

49-
- name: Setup Android SDK (Linux only)
50-
if: matrix.os == 'ubuntu-latest'
51-
uses: android-actions/setup-android@v3
52-
5349
- name: Install dotnet tools
5450
run: dotnet tool restore
5551

56-
- name: Install MAUI workload
52+
- name: Install MAUI workload (Windows/macOS only)
53+
if: matrix.os != 'ubuntu-latest'
5754
run: dotnet workload install maui
5855

5956
- name: Build build tasks (required first)
@@ -80,6 +77,10 @@ jobs:
8077
- name: Run Compatibility Unit Tests
8178
run: dotnet test src/Compatibility/Core/tests/Compatibility.UnitTests/Compatibility.Core.UnitTests.csproj --no-build --configuration Release --logger trx --collect:"XPlat Code Coverage"
8279

80+
- name: Test Android build (Windows/macOS only)
81+
if: matrix.os != 'ubuntu-latest'
82+
run: dotnet build src/Controls/samples/Maui.Controls.Sample/Maui.Controls.Sample.csproj -f net9.0-android --configuration Release
83+
8384
- name: Upload test results
8485
uses: actions/upload-artifact@v4
8586
if: always()

.github/workflows/ci-extended-build.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,13 @@ jobs:
4343
- name: Install dotnet tools
4444
run: dotnet tool restore
4545

46-
- name: Install MAUI workload
47-
run: dotnet workload install maui
48-
49-
- name: Build build tasks
46+
- name: Build build tasks (Linux - core only)
5047
run: dotnet build ./Microsoft.Maui.BuildTasks.slnf
5148

5249
- name: Build and test core
5350
id: build
5451
run: |
55-
echo "Building core solution..."
52+
echo "Building core solution (Linux - no platform workloads)..."
5653
dotnet build Microsoft.Maui.sln --configuration Release
5754
5855
echo "Running unit tests..."
@@ -94,8 +91,8 @@ jobs:
9491
- name: Install dotnet tools
9592
run: dotnet tool restore
9693

97-
- name: Install MAUI workload
98-
run: dotnet workload install maui
94+
- name: Install MAUI Android workload
95+
run: dotnet workload install android
9996

10097
- name: Build build tasks
10198
run: dotnet build ./Microsoft.Maui.BuildTasks.slnf
@@ -128,8 +125,8 @@ jobs:
128125
- name: Install dotnet tools
129126
run: dotnet tool restore
130127

131-
- name: Install MAUI workload
132-
run: dotnet workload install maui
128+
- name: Install MAUI iOS workload
129+
run: dotnet workload install ios maccatalyst
133130

134131
- name: Build build tasks
135132
run: dotnet build ./Microsoft.Maui.BuildTasks.slnf
@@ -163,8 +160,8 @@ jobs:
163160
- name: Install dotnet tools
164161
run: dotnet tool restore
165162

166-
- name: Install MAUI workload
167-
run: dotnet workload install maui
163+
- name: Install MAUI Android workload
164+
run: dotnet workload install android
168165

169166
- name: Build device tests
170167
run: |

.github/workflows/staged-ci-orchestrator.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ jobs:
5959
- name: Install dotnet tools
6060
run: dotnet tool restore
6161

62-
- name: Install MAUI workload
63-
run: dotnet workload install maui
62+
- name: Install Android workload only (Linux)
63+
run: dotnet workload install android
6464

6565
- name: Build and test
6666
id: build-test

0 commit comments

Comments
 (0)