Test .NET MAUI Android App #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Don't forget to add these secrets in your GitHub repository: | |
# - APPCENTER_TOKEN_ANDROID: This is an API key for App Center specific to your Android app listing | |
name: Test .NET MAUI Android App | |
on: | |
workflow_dispatch: | |
env: | |
BUILD_CONFIGURATION: Release | |
DOTNET_VERSION: 7.0.x | |
MAUI_CSPROJ_TO_BUILD: MauiUITestSample/MauiUITestSample.csproj | |
UITEST_CSPROJ_TO_BUILD: MyAppTests/MyAppTests.csproj | |
# Find this in the ApplicationId node in the .NET MAUI csproj file | |
APP_ID: com.companyname.mauiuitestsample | |
# App Center configuration | |
TEST_DEVICES: ff8f571c | |
APP_DEFINITION: xtc-Xamarin-Forms/MauiTest | |
TEST_SERIES: master | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Install .NET MAUI Workload | |
run: dotnet workload install maui | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Publish .NET MAUI Android App | |
run: dotnet publish ${{ env.MAUI_CSPROJ_TO_BUILD }} -c ${{ env.BUILD_CONFIGURATION }} -f net7.0-android -o ${{ github.workspace }}\\artifacts | |
- name: Build UITest Project | |
run: dotnet build ${{ env.UITEST_CSPROJ_TO_BUILD }} -c ${{ env.BUILD_CONFIGURATION }} | |
- name: Install App Center CLI | |
run: npm install --location=global appcenter-cli | |
- name: Upload App to Test Cloud | |
run: appcenter test run uitest --app "${{ env.APP_DEFINITION }}" --devices "${{ env.TEST_DEVICES }}" --app-path "${{ github.workspace }}\\artifacts\\${{ env.APP_ID }}-Signed.apk" --test-series "${{ env.TEST_SERIES }}" --build-dir "MyAppTests/bin/${{ env.BUILD_CONFIGURATION }}/net48/" --uitest-tools-dir "MyAppTests/bin/${{ env.BUILD_CONFIGURATION }}/net48/" --token "${{ secrets.APPCENTER_TOKEN_ANDROID }}" --async |