-
-
Notifications
You must be signed in to change notification settings - Fork 92
95 lines (75 loc) · 2.98 KB
/
dotnet-maui.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Dotnet Maui Build and Test
on:
workflow_call:
jobs:
dotnet-maui-build:
runs-on: macos-14
env:
USE_WHISPER_MAUI: "TRUE"
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
- name: Download Artifacts
id: download-artifact
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: runtimes
- name: Install dotnet workloads
run: |
dotnet workload install maui --ignore-failed-sources
dotnet workload install tvos --ignore-failed-sources
- name: Restore dependencies
run: dotnet restore ./Whisper.net.Maui.Tests.sln
- name: Publish android build
run: dotnet publish ./tests/Whisper.net.Maui.Tests/Whisper.net.Maui.Tests.csproj -c Debug -f net9.0-android -p:EmbedAssembliesIntoApk=true
- name: Upload apk and ios app
uses: actions/upload-artifact@v4
with:
name: maui-build-artifacts
path: |
./tests/Whisper.net.Maui.Tests/bin/Debug/net9.0-android/com.companyname.whisper.net.maui.tests-Signed.apk
dotnet-maui-test-android:
runs-on: ubuntu-latest
needs: dotnet-maui-build
env:
USE_WHISPER_MAUI: "TRUE"
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
- name: Download Artifacts
id: download-artifact
uses: actions/download-artifact@v4
with:
name: maui-build-artifacts
path: maui-build-artifacts
- name: Enable KVM group perms
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: Install xharness
run: dotnet tool install Microsoft.DotNet.XHarness.CLI --global --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json --version "10.0.0-*"
- name: run android tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
arch: x86_64
script: xharness android test --app=./maui-build-artifacts/com.companyname.whisper.net.maui.tests-Signed.apk -p com.companyname.whisper.net.maui.tests -i com.companyname.whisper.net.maui.tests.AndroidMauiTestInstrumentation -o=./test-results/android
- name: Upload Maui Android xharness test results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: xharness-android-test-results
path: |
./test-results/*