Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to get Android to run on CI #3

Merged
merged 94 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
1640665
Start adding test runs
mattleibow Jul 7, 2023
bddfb21
Update dotnet.yml
mattleibow Jul 7, 2023
d971e82
Update dotnet.yml
mattleibow Jul 7, 2023
da92200
Update dotnet.yml
mattleibow Jul 7, 2023
bb10752
Update dotnet.yml
mattleibow Jul 7, 2023
68bc9e8
Update dotnet.yml
mattleibow Jul 7, 2023
fa9ebd8
Update dotnet.yml
mattleibow Jul 7, 2023
2b4842e
Update dotnet.yml
mattleibow Jul 7, 2023
d088080
try composite actions
mattleibow Jul 7, 2023
e962f1d
oops
mattleibow Jul 7, 2023
894efa1
this
mattleibow Jul 7, 2023
9d8ac3a
shells
mattleibow Jul 7, 2023
b33e2a7
Split the runs
mattleibow Jul 7, 2023
82e562e
Update build.yml
mattleibow Jul 7, 2023
4a91031
More things
mattleibow Jul 7, 2023
9253c9b
reset for tests
mattleibow Jul 7, 2023
c6269ae
Update test.yml
mattleibow Jul 7, 2023
e6bd1c8
wait and check forever
mattleibow Jul 7, 2023
b417c9e
sadf
mattleibow Jul 7, 2023
c03f79d
too many logs!
mattleibow Jul 7, 2023
ca7fc61
see more
mattleibow Jul 7, 2023
dab440a
Update test.yml
mattleibow Jul 7, 2023
bf3e695
Update test.yml
mattleibow Jul 7, 2023
f84d992
Merge branch 'main' into dev/testing
mattleibow Jul 29, 2024
7d2524a
this
mattleibow Jul 29, 2024
df57e27
Use arm64 since that is what all devices are
mattleibow Jul 29, 2024
7f427eb
names
mattleibow Jul 29, 2024
94e4ed9
i can't get arm64 :(
mattleibow Jul 29, 2024
1b0748b
Try linux
mattleibow Jul 29, 2024
35360e2
this
mattleibow Jul 29, 2024
21d6a3c
:(
mattleibow Jul 29, 2024
14d18ed
set
mattleibow Jul 29, 2024
baec656
java
mattleibow Jul 29, 2024
403d162
ms
mattleibow Jul 29, 2024
a37d63d
hax
mattleibow Jul 29, 2024
9ba9427
platform-tools
mattleibow Jul 29, 2024
8ca1a29
use that
mattleibow Jul 29, 2024
59bbcd2
linux
mattleibow Jul 29, 2024
3feb3ef
comments
mattleibow Jul 29, 2024
2368cd8
oops
mattleibow Jul 29, 2024
29fe432
net8.0
mattleibow Jul 29, 2024
67d30f4
:)
mattleibow Jul 29, 2024
fd31197
tt
mattleibow Jul 29, 2024
e613398
java
mattleibow Jul 29, 2024
7e35c1f
this
mattleibow Jul 29, 2024
acef0a6
closer
mattleibow Jul 29, 2024
fff5f93
try macos
mattleibow Jul 29, 2024
bd23ca6
tests
mattleibow Jul 29, 2024
591c1a4
Revert "tests"
mattleibow Jul 30, 2024
1941e36
Revert "try macos"
mattleibow Jul 30, 2024
ac3769c
test
mattleibow Jul 30, 2024
774b229
manual run
mattleibow Jul 30, 2024
57a196b
this
mattleibow Jul 30, 2024
d1a9bcd
.android
mattleibow Jul 30, 2024
6039116
meow
mattleibow Jul 30, 2024
b6181c9
why
mattleibow Jul 30, 2024
505accf
diff
mattleibow Jul 30, 2024
0b5298c
maybe
mattleibow Jul 30, 2024
a60400a
:)
mattleibow Jul 30, 2024
9a9ca6d
debug
mattleibow Jul 30, 2024
3309156
dsaf
mattleibow Jul 30, 2024
bc75e5a
this
mattleibow Jul 30, 2024
aca78c5
desperation
mattleibow Jul 30, 2024
5d6aca8
safd
mattleibow Jul 30, 2024
c6ec711
faaast
mattleibow Jul 30, 2024
bbdb732
this
mattleibow Jul 30, 2024
1f6f037
set
mattleibow Jul 30, 2024
1d7f433
hmmm
mattleibow Jul 30, 2024
212ccb1
:(
mattleibow Jul 30, 2024
46c0776
hackers
mattleibow Jul 30, 2024
9fb6816
paths
mattleibow Jul 30, 2024
c989068
emu
mattleibow Jul 30, 2024
4b6e353
em
mattleibow Jul 30, 2024
1a24b0b
this
mattleibow Jul 30, 2024
edecc8a
test
mattleibow Jul 30, 2024
71a2b90
adb yo
mattleibow Jul 30, 2024
bfdcb72
less
mattleibow Jul 30, 2024
75c9df1
this
mattleibow Jul 30, 2024
fa3ffde
this
mattleibow Jul 30, 2024
03bd21b
ANDROID_HOME
mattleibow Jul 30, 2024
2f0ad33
cat
mattleibow Jul 30, 2024
4d9b1ae
print
mattleibow Jul 30, 2024
671c4ff
start
mattleibow Jul 30, 2024
04fdf13
wait and kill
mattleibow Jul 30, 2024
6ca9e1d
this
mattleibow Jul 30, 2024
63c8217
try this
mattleibow Aug 17, 2024
53080e7
:(
mattleibow Aug 17, 2024
06b6920
Merge remote-tracking branch 'origin/main' into dev/testing
mattleibow Aug 17, 2024
6bfbbee
300
mattleibow Aug 17, 2024
c590098
emu
mattleibow Aug 17, 2024
3cc7496
out
mattleibow Aug 17, 2024
cc72d01
Update test-xharness-ios.yml
mattleibow Aug 17, 2024
905a570
Update test-xharness-maccatalyst.yml
mattleibow Aug 17, 2024
332183b
Update build.yml
mattleibow Aug 17, 2024
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
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
]
},
"androidsdk.tool": {
"version": "0.9.0",
"version": "0.11.0",
"commands": [
"android"
]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

macos:
name: macOS
runs-on: macos-13
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/setup-tools/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ runs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
dotnet-version: 8.0.304
- name: Setup .NET MAUI
if: runner.os != 'Windows'
if: runner.os == 'Linux'
shell: pwsh
run: dotnet workload install maui-android --source https://api.nuget.org/v3/index.json
- name: Setup .NET MAUI
if: runner.os == 'macOS'
shell: pwsh
run: dotnet workload install maui --source https://api.nuget.org/v3/index.json
- name: Setup Tizen.NET
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/test-xharness-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: XHarness Android Test

on:
pull_request:
push:
branches: [ main, 'releases/**' ]
release:
types: [ published ]

jobs:

android:
strategy:
matrix:
platform:
- name: Linux
os: ubuntu-22.04
gpu: swiftshader_indirect
- name: macOS
os: macos-13
gpu: guest
name: Android (${{ matrix.platform.name}})
runs-on: ${{ matrix.platform.os }}
env:
TEST_TARGET_FRAMEWORK: net8.0-android
TEST_RUNTIME_IDENTIFIER: android-x64
TEST_CONFIGURATION: Release
TEST_EMULATOR_NAME: XHarnessEmulator
TEST_EMULATOR_IMAGE: system-images;android-34;google_apis;x86_64
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Required Tools
uses: ./.github/workflows/setup-tools
- uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: '21'
- name: Install Android SDK Packages
run: dotnet android sdk install --package 'platform-tools' --package 'emulator' --package '${{ env.TEST_EMULATOR_IMAGE }}'
- name: Create Emulator
run: dotnet android avd create --name ${{ env.TEST_EMULATOR_NAME }} --sdk '${{ env.TEST_EMULATOR_IMAGE }}' --force
- name: Enable KVM
if: runner.os == 'Linux'
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Start Emulator
run: dotnet android avd start --name ${{ env.TEST_EMULATOR_NAME }} --gpu ${{ matrix.platform.gpu }} --wait-boot --no-window --no-snapshot --no-audio --no-boot-anim
- name: Publish App
run: |
dotnet publish sample/SampleMauiApp/SampleMauiApp.csproj \
-f ${{ env.TEST_TARGET_FRAMEWORK }} \
-r ${{ env.TEST_RUNTIME_IDENTIFIER }} \
-c ${{ env.TEST_CONFIGURATION }} \
-p:TestingMode=XHarness \
-p:AndroidSdkDirectory=$ANDROID_SDK_ROOT \
/bl:./artifacts/logs/msbuild-publish.binlog
- name: Run Tests
run: |
dotnet xharness android test \
--timeout="00:05:00" \
--launch-timeout=00:10:00 \
--package-name com.companyname.samplemauiapp \
--instrumentation devicerunners.xharness.maui.XHarnessInstrumentation \
--app sample/SampleMauiApp/bin/${{ env.TEST_CONFIGURATION }}/${{ env.TEST_TARGET_FRAMEWORK }}/${{ env.TEST_RUNTIME_IDENTIFIER }}/publish/com.companyname.samplemauiapp-Signed.apk \
--output-directory artifacts
- name: Shutdown the Emulator
run: dotnet xharness android adb -- emu kill
- name: Upload Artifacts
uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
name: Test Results - Android (Linux)
path: ./artifacts
50 changes: 50 additions & 0 deletions .github/workflows/test-xharness-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: XHarness iOS Test

on:
pull_request:
push:
branches: [ main, 'releases/**' ]
release:
types: [ published ]

jobs:

ios:
name: iOS
runs-on: macos-14
env:
TEST_TARGET_FRAMEWORK: net8.0-ios
TEST_RUNTIME_IDENTIFIER: iossimulator-x64
TEST_CONFIGURATION: Debug
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Required Tools
uses: ./.github/workflows/setup-tools
- name: Publish App
run: |
dotnet build sample/SampleMauiApp/SampleMauiApp.csproj \
-f ${{ env.TEST_TARGET_FRAMEWORK }} \
-r ${{ env.TEST_RUNTIME_IDENTIFIER }} \
-c ${{ env.TEST_CONFIGURATION }} \
-p:TestingMode=XHarness \
/bl:./artifacts/logs/msbuild-publish.binlog
- name: Run Tests
run: |
for i in $(seq 1 3)
do
dotnet xharness apple test \
--target ios-simulator-64 \
--timeout="00:03:00" \
--launch-timeout=00:06:00 \
--app sample/SampleMauiApp/bin/${{ env.TEST_CONFIGURATION }}/${{ env.TEST_TARGET_FRAMEWORK }}/${{ env.TEST_RUNTIME_IDENTIFIER }}/SampleMauiApp.app \
--output-directory artifacts \
&& code=0 && break || code=$? && sleep 15
done
exit $code
- name: Upload Artifacts
uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
name: Test Results - iOS
path: ./artifacts
45 changes: 45 additions & 0 deletions .github/workflows/test-xharness-maccatalyst.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: XHarness Mac Catalyst Test

on:
pull_request:
push:
branches: [ main, 'releases/**' ]
release:
types: [ published ]

jobs:

maccatalyst:
name: Mac Catalyst
runs-on: macos-14
env:
TEST_TARGET_FRAMEWORK: net8.0-maccatalyst
TEST_RUNTIME_IDENTIFIER: maccatalyst-x64
TEST_CONFIGURATION: Debug
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Required Tools
uses: ./.github/workflows/setup-tools
- name: Publish App
run: |
dotnet build sample/SampleMauiApp/SampleMauiApp.csproj \
-f ${{ env.TEST_TARGET_FRAMEWORK }} \
-r ${{ env.TEST_RUNTIME_IDENTIFIER }} \
-c ${{ env.TEST_CONFIGURATION }} \
-p:TestingMode=XHarness \
/bl:./artifacts/logs/msbuild-publish.binlog
- name: Run Tests
run: |
dotnet xharness apple test \
--target maccatalyst \
--timeout="00:02:00" \
--launch-timeout=00:06:00 \
--app sample/SampleMauiApp/bin/${{ env.TEST_CONFIGURATION }}/${{ env.TEST_TARGET_FRAMEWORK }}/${{ env.TEST_RUNTIME_IDENTIFIER }}/SampleMauiApp.app \
--output-directory artifacts
- name: Upload Artifacts
uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
name: Test Results - Mac Catalyst
path: ./artifacts
49 changes: 49 additions & 0 deletions .github/workflows/test-xharness-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: XHarness Windows Test

on:
pull_request:
push:
branches: [ main, 'releases/**' ]
release:
types: [ published ]

jobs:

windows:
name: Windows
runs-on: windows-latest
env:
TEST_TARGET_FRAMEWORK: net8.0-windows10.0.19041.0
TEST_RUNTIME_IDENTIFIER: win10-x64
TEST_CONFIGURATION: Release
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Required Tools
uses: ./.github/workflows/setup-tools
- name: Publish App
run: |
$fingerprint = ./scripts/New-Certificate.ps1 -Project sample/SampleMauiApp/SampleMauiApp.csproj
dotnet publish sample/SampleMauiApp/SampleMauiApp.csproj `
-f ${{ env.TEST_TARGET_FRAMEWORK }} `
-c ${{ env.TEST_CONFIGURATION }} `
-p:TestingMode=XHarness `
-p:AppxPackageSigningEnabled=true `
-p:PackageCertificateThumbprint=$fingerprint `
-p:PackageCertificateKeyFile="" `
/bl:./artifacts/logs/msbuild-publish.binlog
./scripts/Remove-Certificate.ps1 -CertificateFingerprint $fingerprint
- name: Run Tests
run: |
$msix = Get-ChildItem "sample/SampleMauiApp/bin/${{ env.TEST_CONFIGURATION }}/${{ env.TEST_TARGET_FRAMEWORK }}/${{ env.TEST_RUNTIME_IDENTIFIER }}/AppPackages/*_Test/*.msix"
./scripts/Start-Tests.ps1 `
-App $msix `
-OutputDirectory artifacts `
-TestingMode XHarness
shell: powershell
- name: Upload Artifacts
uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
name: Test Results - Windows
path: ./artifacts
Loading
Loading