-
Notifications
You must be signed in to change notification settings - Fork 236
143 lines (124 loc) · 4.22 KB
/
e2e.yml
File metadata and controls
143 lines (124 loc) · 4.22 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: E2E Tests
on:
push:
branches:
- rel/**
workflow_dispatch:
inputs:
platform:
description: 'Platform to test'
required: true
default: 'both'
type: choice
options:
- android
- ios
- both
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-android:
if: >-
github.event_name == 'push' ||
github.event.inputs.platform == 'android' ||
github.event.inputs.platform == 'both'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Flutter
uses: ./.github/actions/setup-flutter
with:
working-directory: examples/demo
- name: Set up Android build
uses: ./.github/actions/setup-android-build
- name: Create demo .env
uses: ./.github/actions/create-demo-env
with:
onesignal-app-id: ${{ vars.APPIUM_ONESIGNAL_APP_ID }}
onesignal-api-key: ${{ secrets.APPIUM_ONESIGNAL_API_KEY }}
- name: Build release APK
working-directory: examples/demo
run: flutter build apk --release
- name: Upload APK
uses: actions/upload-artifact@v7
with:
name: demo-apk
path: examples/demo/build/app/outputs/flutter-apk/app-release.apk
retention-days: 1
compression-level: 0
build-ios:
if: >-
github.event_name == 'push' ||
github.event.inputs.platform == 'ios' ||
github.event.inputs.platform == 'both'
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Flutter
uses: ./.github/actions/setup-flutter
with:
working-directory: examples/demo
- name: Set up iOS build
uses: ./.github/actions/setup-ios-build
- name: Create demo .env
uses: ./.github/actions/create-demo-env
with:
onesignal-app-id: ${{ vars.APPIUM_ONESIGNAL_APP_ID }}
onesignal-api-key: ${{ secrets.APPIUM_ONESIGNAL_API_KEY }}
- name: Set up iOS codesigning
uses: OneSignal/sdk-shared/.github/actions/setup-ios-demo-codesigning@main
with:
p12-base64: ${{ secrets.APPIUM_IOS_DEV_CERT_P12_BASE64 }}
p12-password: ${{ secrets.APPIUM_IOS_DEV_CERT_PASSWORD }}
asc-key-id: ${{ secrets.APPIUM_APP_STORE_CONNECT_KEY_ID }}
asc-issuer-id: ${{ secrets.APPIUM_APP_STORE_CONNECT_ISSUER_ID }}
asc-private-key: ${{ secrets.APPIUM_APP_STORE_CONNECT_PRIVATE_KEY }}
- name: Build signed IPA
working-directory: examples/demo
run: |
flutter build ipa --release \
--export-options-plist=ios/ExportOptions.plist \
--split-debug-info=build/symbols
cp build/ios/ipa/*.ipa build/ios/ipa/Runner.ipa
- name: Verify aps-environment in IPA
working-directory: examples/demo
run: |
unzip -oq build/ios/ipa/Runner.ipa -d /tmp/ipa
APP=$(ls -d /tmp/ipa/Payload/*.app | head -n1)
codesign -d --entitlements - "$APP" 2>&1 | tee /tmp/entitlements.txt
if ! grep -q 'aps-environment' /tmp/entitlements.txt; then
echo "::error::Built IPA is missing aps-environment entitlement; push subscription will not work"
exit 1
fi
- name: Upload IPA
uses: actions/upload-artifact@v7
with:
name: demo-ipa
path: examples/demo/build/ios/ipa/Runner.ipa
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-release.apk
sdk-type: flutter
build-name: flutter-android-${{ github.ref_name }}-${{ github.run_number }}
e2e-ios:
needs: build-ios
uses: OneSignal/sdk-shared/.github/workflows/appium-e2e.yml@main
secrets: inherit
with:
platform: ios
app-artifact: demo-ipa
app-filename: Runner.ipa
sdk-type: flutter
build-name: flutter-ios-${{ github.ref_name }}-${{ github.run_number }}