-
Notifications
You must be signed in to change notification settings - Fork 378
82 lines (72 loc) · 2.69 KB
/
e2e.yml
File metadata and controls
82 lines (72 loc) · 2.69 KB
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
name: E2E Tests
on:
push:
branches:
- rel/**
workflow_dispatch:
inputs:
sdk-version:
description: 'OneSignal Android SDK version to wait for and build against (defaults to OneSignalSDK/gradle.properties).'
required: false
type: string
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-android:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up demo
uses: ./.github/actions/setup-demo
with:
onesignal-app-id: ${{ vars.APPIUM_ONESIGNAL_APP_ID }}
onesignal-api-key: ${{ secrets.APPIUM_ONESIGNAL_API_KEY }}
- name: Resolve OneSignal Android SDK version
id: android-sdk-version
env:
INPUT_VERSION: ${{ github.event.inputs.sdk-version }}
run: |
if [ -n "$INPUT_VERSION" ]; then
VERSION="$INPUT_VERSION"
else
VERSION=$(grep -E '^SDK_VERSION=' OneSignalSDK/gradle.properties | cut -d '=' -f2)
fi
if [ -z "$VERSION" ]; then
echo "::error::Could not resolve OneSignal Android SDK version"
exit 1
fi
echo "Resolved OneSignal Android SDK version: $VERSION"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Wait for OneSignal Android SDK on Maven Central
uses: OneSignal/sdk-shared/.github/actions/wait-for-maven-artifact@main
with:
version: ${{ steps.android-sdk-version.outputs.version }}
- name: Build debug APK
working-directory: examples/demo
# Build the gms-debug variant: BrowserStack devices all run Google
# Play Services, and debug ensures isDebuggable=true so Appium's
# UiAutomator2 driver can attach. The Maven-resolved OneSignal
# dependency is pinned to the version we just waited for, so the
# APK exercises the actual published artifact.
run: ./gradlew :app:assembleGmsDebug -PSDK_VERSION=${{ steps.android-sdk-version.outputs.version }} --console=plain --warning-mode=summary
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: demo-apk
path: examples/demo/app/build/outputs/apk/gms/debug/app-gms-debug.apk
retention-days: 1
compression-level: 0
e2e-android:
needs: build-android
uses: OneSignal/sdk-shared/.github/workflows/appium-e2e.yml@main
secrets: inherit
with:
platform: android
app-artifact: demo-apk
app-filename: app-gms-debug.apk
sdk-type: android
build-name: android-${{ github.ref_name }}-${{ github.run_number }}