Skip to content

Commit 2ad0d96

Browse files
committed
ci(e2e): add iOS E2E workflow with signing
1 parent 23516e4 commit 2ad0d96

5 files changed

Lines changed: 213 additions & 21 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: 'Setup Demo'
2+
description: 'Installs XcodeGen, generates the demo Xcode project, and creates Secrets.plist for Appium E2E'
3+
inputs:
4+
onesignal-app-id:
5+
description: 'OneSignal App ID for the demo Secrets.plist'
6+
required: true
7+
onesignal-api-key:
8+
description: 'OneSignal API Key for the demo Secrets.plist'
9+
required: true
10+
runs:
11+
using: 'composite'
12+
steps:
13+
- name: Install XcodeGen
14+
shell: bash
15+
run: brew install xcodegen
16+
17+
- name: Create Secrets.plist
18+
shell: bash
19+
working-directory: examples/demo
20+
run: |
21+
cat > App/Secrets.plist <<EOF
22+
<?xml version="1.0" encoding="UTF-8"?>
23+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
24+
<plist version="1.0">
25+
<dict>
26+
<key>ONESIGNAL_APP_ID</key>
27+
<string>${{ inputs.onesignal-app-id }}</string>
28+
<key>ONESIGNAL_API_KEY</key>
29+
<string>${{ inputs.onesignal-api-key }}</string>
30+
</dict>
31+
</plist>
32+
EOF
33+
34+
- name: Generate Xcode project
35+
shell: bash
36+
working-directory: examples/demo
37+
run: xcodegen generate

.github/workflows/e2e.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: E2E Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- rel/**
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build-ios:
18+
runs-on: macos-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v6
22+
23+
- name: Set up demo
24+
uses: ./.github/actions/setup-demo
25+
with:
26+
onesignal-app-id: ${{ vars.APPIUM_ONESIGNAL_APP_ID }}
27+
onesignal-api-key: ${{ secrets.APPIUM_ONESIGNAL_API_KEY }}
28+
29+
- name: Cache Xcode DerivedData
30+
uses: actions/cache@v5
31+
with:
32+
path: examples/demo/build
33+
key: deriveddata-${{ runner.os }}-${{ hashFiles('examples/demo/project.yml', 'iOS_SDK/OneSignalSDK/OneSignal.xcodeproj/project.pbxproj') }}
34+
restore-keys: deriveddata-${{ runner.os }}-
35+
36+
- name: Set up iOS codesigning
37+
uses: OneSignal/sdk-shared/.github/actions/setup-ios-demo-codesigning@main
38+
with:
39+
p12-base64: ${{ secrets.APPIUM_IOS_DEV_CERT_P12_BASE64 }}
40+
p12-password: ${{ secrets.APPIUM_IOS_DEV_CERT_PASSWORD }}
41+
asc-key-id: ${{ secrets.APPIUM_APP_STORE_CONNECT_KEY_ID }}
42+
asc-issuer-id: ${{ secrets.APPIUM_APP_STORE_CONNECT_ISSUER_ID }}
43+
asc-private-key: ${{ secrets.APPIUM_APP_STORE_CONNECT_PRIVATE_KEY }}
44+
45+
- name: Build signed IPA
46+
run: |
47+
xcodebuild archive \
48+
-workspace iOS_SDK/OneSignalSDK.xcworkspace \
49+
-scheme App \
50+
-configuration Release \
51+
-sdk iphoneos \
52+
-destination 'generic/platform=iOS' \
53+
-archivePath examples/demo/build/App.xcarchive \
54+
-derivedDataPath examples/demo/build \
55+
-quiet \
56+
-hideShellScriptEnvironment \
57+
CODE_SIGN_STYLE=Manual \
58+
COMPILER_INDEX_STORE_ENABLE=NO
59+
xcodebuild -exportArchive \
60+
-archivePath examples/demo/build/App.xcarchive \
61+
-exportOptionsPlist examples/demo/ExportOptions.plist \
62+
-exportPath examples/demo/build/ipa \
63+
-quiet
64+
65+
- name: Verify aps-environment in IPA
66+
working-directory: examples/demo
67+
run: |
68+
IPA=$(ls build/ipa/*.ipa | head -n1)
69+
unzip -oq "$IPA" -d /tmp/ipa
70+
APP=$(ls -d /tmp/ipa/Payload/*.app | head -n1)
71+
codesign -d --entitlements - "$APP" 2>&1 | tee /tmp/entitlements.txt
72+
if ! grep -q 'aps-environment' /tmp/entitlements.txt; then
73+
echo "::error::Built IPA is missing aps-environment entitlement; push subscription will not work"
74+
exit 1
75+
fi
76+
77+
- name: Upload IPA
78+
uses: actions/upload-artifact@v7
79+
with:
80+
name: demo-ipa
81+
path: examples/demo/build/ipa/App.ipa
82+
retention-days: 1
83+
compression-level: 0
84+
85+
e2e-ios:
86+
needs: build-ios
87+
uses: OneSignal/sdk-shared/.github/workflows/appium-e2e.yml@main
88+
secrets: inherit
89+
with:
90+
platform: ios
91+
app-artifact: demo-ipa
92+
app-filename: App.ipa
93+
sdk-type: ios
94+
build-name: ios-${{ github.ref_name }}-${{ github.run_number }}

examples/demo/App.xcodeproj/project.pbxproj

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@
358358
E194A3F19072CB17A8F1A12E /* SmsSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SmsSection.swift; sourceTree = "<group>"; };
359359
ECAC7EF0B67920F9FEC4F129 /* TagsSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagsSection.swift; sourceTree = "<group>"; };
360360
F46DFACB9F304B9374F3C570 /* ToastView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastView.swift; sourceTree = "<group>"; };
361-
"TEMP_196A01E1-FF4D-4A91-B9D6-E6100CF24C88" /* Build.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Build.xcconfig; sourceTree = "<group>"; };
361+
"TEMP_DC7C23A8-0C63-401D-818D-D7422DA7CD89" /* Build.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Build.xcconfig; sourceTree = "<group>"; };
362362
/* End PBXFileReference section */
363363

364364
/* Begin PBXFrameworksBuildPhase section */
@@ -564,10 +564,10 @@
564564
path = Views;
565565
sourceTree = "<group>";
566566
};
567-
"TEMP_BC60B80C-3553-4130-8508-42B5AB6C4C1B" /* demo */ = {
567+
"TEMP_DDD6A1C2-65A4-44B3-A895-1C1FDC3B4323" /* demo */ = {
568568
isa = PBXGroup;
569569
children = (
570-
"TEMP_196A01E1-FF4D-4A91-B9D6-E6100CF24C88" /* Build.xcconfig */,
570+
"TEMP_DC7C23A8-0C63-401D-818D-D7422DA7CD89" /* Build.xcconfig */,
571571
);
572572
path = demo;
573573
sourceTree = "<group>";
@@ -658,18 +658,6 @@
658658
BuildIndependentTargetsInParallel = YES;
659659
LastUpgradeCheck = 1430;
660660
TargetAttributes = {
661-
61033D7807F09753830EDBC1 = {
662-
DevelopmentTeam = "";
663-
ProvisioningStyle = Automatic;
664-
};
665-
93E9E330FC2CE7458D9C925F = {
666-
DevelopmentTeam = "";
667-
ProvisioningStyle = Automatic;
668-
};
669-
97373B3889FBDD1762E98B03 = {
670-
DevelopmentTeam = "";
671-
ProvisioningStyle = Automatic;
672-
};
673661
};
674662
};
675663
buildConfigurationList = B3FD05C59F197F398A0B04AB /* Build configuration list for PBXProject "App" */;
@@ -948,10 +936,11 @@
948936
/* Begin XCBuildConfiguration section */
949937
0D2EF3911CA89837C30DB0D1 /* Debug */ = {
950938
isa = XCBuildConfiguration;
951-
baseConfigurationReference = "TEMP_196A01E1-FF4D-4A91-B9D6-E6100CF24C88" /* Build.xcconfig */;
939+
baseConfigurationReference = "TEMP_DC7C23A8-0C63-401D-818D-D7422DA7CD89" /* Build.xcconfig */;
952940
buildSettings = {
953941
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
954942
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
943+
DEVELOPMENT_TEAM = 99SW8E36CT;
955944
INFOPLIST_FILE = OneSignalWidget/Info.plist;
956945
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
957946
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
@@ -965,11 +954,12 @@
965954
};
966955
4A0C935808978B5A7673E412 /* Debug */ = {
967956
isa = XCBuildConfiguration;
968-
baseConfigurationReference = "TEMP_196A01E1-FF4D-4A91-B9D6-E6100CF24C88" /* Build.xcconfig */;
957+
baseConfigurationReference = "TEMP_DC7C23A8-0C63-401D-818D-D7422DA7CD89" /* Build.xcconfig */;
969958
buildSettings = {
970959
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
971960
CODE_SIGN_ENTITLEMENTS = App.entitlements;
972961
CODE_SIGN_IDENTITY = "iPhone Developer";
962+
DEVELOPMENT_TEAM = 99SW8E36CT;
973963
ENABLE_USER_SCRIPT_SANDBOXING = NO;
974964
INFOPLIST_FILE = App/Info.plist;
975965
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
@@ -1044,14 +1034,20 @@
10441034
};
10451035
D0E56A85F1C385808720F94B /* Release */ = {
10461036
isa = XCBuildConfiguration;
1047-
baseConfigurationReference = "TEMP_196A01E1-FF4D-4A91-B9D6-E6100CF24C88" /* Build.xcconfig */;
1037+
baseConfigurationReference = "TEMP_DC7C23A8-0C63-401D-818D-D7422DA7CD89" /* Build.xcconfig */;
10481038
buildSettings = {
10491039
CODE_SIGN_ENTITLEMENTS = OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements;
1040+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1041+
CODE_SIGN_STYLE = Manual;
1042+
DEVELOPMENT_TEAM = "";
1043+
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 99SW8E36CT;
10501044
INFOPLIST_FILE = OneSignalNotificationServiceExtension/Info.plist;
10511045
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
10521046
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
10531047
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.NSE;
10541048
PRODUCT_NAME = "$(TARGET_NAME)";
1049+
PROVISIONING_PROFILE_SPECIFIER = "";
1050+
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Appium Demo - NSE";
10551051
SDKROOT = iphoneos;
10561052
SKIP_INSTALL = YES;
10571053
TARGETED_DEVICE_FAMILY = "1,2";
@@ -1060,33 +1056,44 @@
10601056
};
10611057
EB1CC3A930E09FEBECF9195D /* Release */ = {
10621058
isa = XCBuildConfiguration;
1063-
baseConfigurationReference = "TEMP_196A01E1-FF4D-4A91-B9D6-E6100CF24C88" /* Build.xcconfig */;
1059+
baseConfigurationReference = "TEMP_DC7C23A8-0C63-401D-818D-D7422DA7CD89" /* Build.xcconfig */;
10641060
buildSettings = {
10651061
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
10661062
CODE_SIGN_ENTITLEMENTS = App.entitlements;
10671063
CODE_SIGN_IDENTITY = "iPhone Developer";
1064+
CODE_SIGN_STYLE = Manual;
1065+
DEVELOPMENT_TEAM = "";
1066+
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 99SW8E36CT;
10681067
ENABLE_USER_SCRIPT_SANDBOXING = NO;
10691068
INFOPLIST_FILE = App/Info.plist;
10701069
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
10711070
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
10721071
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example;
10731072
PRODUCT_NAME = "$(TARGET_NAME)";
1073+
PROVISIONING_PROFILE_SPECIFIER = "";
1074+
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Appium Demo - Main";
10741075
SDKROOT = iphoneos;
10751076
TARGETED_DEVICE_FAMILY = "1,2";
10761077
};
10771078
name = Release;
10781079
};
10791080
F305A3E63851EE49DA2D190E /* Release */ = {
10801081
isa = XCBuildConfiguration;
1081-
baseConfigurationReference = "TEMP_196A01E1-FF4D-4A91-B9D6-E6100CF24C88" /* Build.xcconfig */;
1082+
baseConfigurationReference = "TEMP_DC7C23A8-0C63-401D-818D-D7422DA7CD89" /* Build.xcconfig */;
10821083
buildSettings = {
10831084
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
10841085
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
1086+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1087+
CODE_SIGN_STYLE = Manual;
1088+
DEVELOPMENT_TEAM = "";
1089+
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 99SW8E36CT;
10851090
INFOPLIST_FILE = OneSignalWidget/Info.plist;
10861091
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
10871092
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
10881093
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.LA;
10891094
PRODUCT_NAME = "$(TARGET_NAME)";
1095+
PROVISIONING_PROFILE_SPECIFIER = "";
1096+
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Appium Demo - Live Activity";
10901097
SDKROOT = iphoneos;
10911098
SKIP_INSTALL = YES;
10921099
TARGETED_DEVICE_FAMILY = "1,2";
@@ -1095,9 +1102,10 @@
10951102
};
10961103
F5FD25168D9B32A08A468069 /* Debug */ = {
10971104
isa = XCBuildConfiguration;
1098-
baseConfigurationReference = "TEMP_196A01E1-FF4D-4A91-B9D6-E6100CF24C88" /* Build.xcconfig */;
1105+
baseConfigurationReference = "TEMP_DC7C23A8-0C63-401D-818D-D7422DA7CD89" /* Build.xcconfig */;
10991106
buildSettings = {
11001107
CODE_SIGN_ENTITLEMENTS = OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements;
1108+
DEVELOPMENT_TEAM = 99SW8E36CT;
11011109
INFOPLIST_FILE = OneSignalNotificationServiceExtension/Info.plist;
11021110
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
11031111
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";

examples/demo/ExportOptions.plist

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>method</key>
6+
<string>development</string>
7+
<key>teamID</key>
8+
<string>99SW8E36CT</string>
9+
<key>signingStyle</key>
10+
<string>manual</string>
11+
<key>stripSwiftSymbols</key>
12+
<true/>
13+
<key>provisioningProfiles</key>
14+
<dict>
15+
<key>com.onesignal.example</key>
16+
<string>Appium Demo - Main</string>
17+
<key>com.onesignal.example.NSE</key>
18+
<string>Appium Demo - NSE</string>
19+
<key>com.onesignal.example.LA</key>
20+
<string>Appium Demo - Live Activity</string>
21+
</dict>
22+
</dict>
23+
</plist>

examples/demo/project.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ targets:
5959
TARGETED_DEVICE_FAMILY: "1,2"
6060
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/Frameworks"
6161
ENABLE_USER_SCRIPT_SANDBOXING: NO
62+
configs:
63+
Debug:
64+
DEVELOPMENT_TEAM: 99SW8E36CT
65+
Release:
66+
CODE_SIGN_IDENTITY: "iPhone Developer"
67+
CODE_SIGN_STYLE: Manual
68+
DEVELOPMENT_TEAM: ""
69+
"DEVELOPMENT_TEAM[sdk=iphoneos*]": 99SW8E36CT
70+
PROVISIONING_PROFILE_SPECIFIER: ""
71+
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]": "Appium Demo - Main"
6272
dependencies:
6373
# SDK Swift framework targets (built from local source via the workspace)
6474
- target: OneSignalSDK/OneSignalCore
@@ -123,6 +133,16 @@ targets:
123133
TARGETED_DEVICE_FAMILY: "1,2"
124134
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"
125135
SKIP_INSTALL: YES
136+
configs:
137+
Debug:
138+
DEVELOPMENT_TEAM: 99SW8E36CT
139+
Release:
140+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]": "iPhone Developer"
141+
CODE_SIGN_STYLE: Manual
142+
DEVELOPMENT_TEAM: ""
143+
"DEVELOPMENT_TEAM[sdk=iphoneos*]": 99SW8E36CT
144+
PROVISIONING_PROFILE_SPECIFIER: ""
145+
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]": "Appium Demo - NSE"
126146
dependencies:
127147
- target: OneSignalSDK/OneSignalCore
128148
embed: false
@@ -156,6 +176,16 @@ targets:
156176
SKIP_INSTALL: YES
157177
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME: AccentColor
158178
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME: WidgetBackground
179+
configs:
180+
Debug:
181+
DEVELOPMENT_TEAM: 99SW8E36CT
182+
Release:
183+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]": "iPhone Developer"
184+
CODE_SIGN_STYLE: Manual
185+
DEVELOPMENT_TEAM: ""
186+
"DEVELOPMENT_TEAM[sdk=iphoneos*]": 99SW8E36CT
187+
PROVISIONING_PROFILE_SPECIFIER: ""
188+
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]": "Appium Demo - Live Activity"
159189
dependencies:
160190
- target: OneSignalSDK/OneSignalLiveActivities
161191
embed: false

0 commit comments

Comments
 (0)