Skip to content

Commit 0837004

Browse files
authored
install android SDK automatically in CI (#3026)
* install android SDK automatically in CI * avoid hard-coded paths * try 1 * java 17 * fixup merge * comments * cleanup * cleanup * fix integration test
1 parent 9069e87 commit 0837004

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

.github/actions/environment/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ runs:
1111
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" >> $GITHUB_ENV
1212
echo "DOTNET_NOLOGO=1" >> $GITHUB_ENV
1313
14+
# Needed for Android SDK setup step
15+
- uses: actions/setup-java@v3
16+
with:
17+
distribution: 'temurin'
18+
java-version: '17'
19+
20+
- name: Setup Android SDK
21+
uses: android-actions/setup-android@07976c6290703d34c16d382cb36445f98bb43b1f # v3.2.0
22+
1423
- name: Set Java Version
1524
uses: actions/setup-java@v3
1625
with:

.github/workflows/build.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,15 @@ jobs:
180180
with:
181181
dotnet-version: 8.0.x
182182

183+
# Needed for Android SDK setup step
184+
- uses: actions/setup-java@v3
185+
with:
186+
distribution: 'temurin'
187+
java-version: '17'
188+
189+
- name: Setup Android SDK
190+
uses: android-actions/setup-android@07976c6290703d34c16d382cb36445f98bb43b1f # v3.2.0
191+
183192
- run: dotnet workload install android maui-android
184193

185194
- name: Test

.github/workflows/device-tests-android.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ jobs:
2525
with:
2626
submodules: recursive
2727

28-
- name: Set Java Version
29-
uses: actions/setup-java@v4
30-
with:
31-
distribution: "temurin"
32-
java-version: "11"
33-
3428
- name: Setup Environment
3529
uses: ./.github/actions/environment
3630

scripts/device-test.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ param(
99
)
1010

1111
Set-StrictMode -Version latest
12-
$ErrorActionPreference = "Stop"
12+
$ErrorActionPreference = 'Stop'
1313

1414
if (!$Build -and !$Run)
1515
{
@@ -50,7 +50,7 @@ try
5050
dotnet build -f $tfm -c Release test/Sentry.Maui.Device.TestApp
5151
if ($LASTEXITCODE -ne 0)
5252
{
53-
throw "Failed to build Sentry.Maui.Device.TestApp"
53+
throw 'Failed to build Sentry.Maui.Device.TestApp'
5454
}
5555
}
5656

@@ -59,7 +59,7 @@ try
5959
if (!(Get-Command xharness -ErrorAction SilentlyContinue))
6060
{
6161
Push-Location ($CI ? $env:RUNNER_TEMP : $IsWindows ? $env:TMP : $IsMacos ? $env:TMPDIR : '/temp')
62-
dotnet tool install Microsoft.DotNet.XHarness.CLI --global --version "1.*-*" `
62+
dotnet tool install Microsoft.DotNet.XHarness.CLI --global --version '1.*-*' `
6363
--add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json
6464
Pop-Location
6565
}
@@ -70,7 +70,7 @@ try
7070
xharness $group test $arguments --output-directory=test_output
7171
if ($LASTEXITCODE -ne 0)
7272
{
73-
throw "xharness run failed with non-zero exit code"
73+
throw 'xharness run failed with non-zero exit code'
7474
}
7575
}
7676
finally

0 commit comments

Comments
 (0)