Skip to content

Commit d8a1ff5

Browse files
authored
Update spm quickstarts with CI script (#1255)
* Generalize spm script * Update performance.yml * Update database.yml * Update abtesting.yml * Update crashlytics.yml * Update crashlytics deployment target versions * Update crashlytics schemes
1 parent d85f160 commit d8a1ff5

12 files changed

+354
-147
lines changed

.github/workflows/abtesting.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,15 @@ jobs:
4747
LEGACY: true
4848
- name: Build and Test SwiftUI
4949
run: |
50-
./scripts/test_spm.sh
50+
cd scripts
51+
source install_prereqs/abtesting.sh
52+
cd ..
53+
source scripts/test_spm.sh
5154
env:
5255
SAMPLE: ABTesting
5356
DIR: abtesting
5457
OS: iOS
55-
PLATFORM: iphone
5658
DEVICE: iPhone 11
5759
SWIFT_DEFINES: ""
60+
TEST: true
5861
secrets_passphrase: ${{ secrets.GHASECRETSGPGPASSPHRASE1 }}

.github/workflows/crashlytics.yml

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -53,49 +53,53 @@ jobs:
5353
LEGACY: true
5454
- name: Build SwiftUI (iOS)
5555
run: |
56-
cd crashlytics
57-
../scripts/install_prereqs/crashlytics.sh
58-
xcodebuild \
59-
-project CrashlyticsExample.xcodeproj \
60-
-scheme 'CrashlyticsSwiftUIExample (iOS)' \
61-
-destination 'platform=iOS Simulator,name=iPhone 11' \
62-
build
56+
cd scripts
57+
source install_prereqs/crashlytics.sh
58+
cd ..
59+
source scripts/test_spm.sh
6360
env:
6461
SAMPLE: Crashlytics
62+
DIR: crashlytics
63+
OS: iOS
64+
DEVICE: iPhone 11
65+
SWIFT_DEFINES: ""
66+
TEST: false
6567
- name: Build SwiftUI (tvOS)
6668
run: |
67-
cd crashlytics
68-
../scripts/install_prereqs/crashlytics.sh
69-
xcodebuild \
70-
-project CrashlyticsExample.xcodeproj \
71-
-scheme 'CrashlyticsSwiftUIExample' \
72-
-sdk appletvsimulator \
73-
build
74-
env:
69+
cd scripts
70+
source install_prereqs/crashlytics.sh
71+
cd ..
72+
source scripts/test_spm.sh
73+
env:
7574
SAMPLE: Crashlytics
75+
DIR: crashlytics
76+
OS: tvOS
77+
DEVICE: Apple TV
78+
SWIFT_DEFINES: ""
79+
TEST: false
7680
- name: Build SwiftUI (macOS)
7781
run: |
78-
cd crashlytics
79-
../scripts/install_prereqs/crashlytics.sh
80-
xcodebuild \
81-
-project CrashlyticsExample.xcodeproj \
82-
-scheme 'CrashlyticsSwiftUIExample (macOS)' \
83-
-sdk macosx \
84-
build
82+
cd scripts
83+
source install_prereqs/crashlytics.sh
84+
cd ..
85+
source scripts/test_spm.sh
86+
env:
87+
SAMPLE: Crashlytics
88+
DIR: crashlytics
89+
OS: macOS
90+
DEVICE: localhost
91+
SWIFT_DEFINES: ""
92+
TEST: false
93+
- name: Build SwiftUI (watchOS)
94+
run: |
95+
cd scripts
96+
source install_prereqs/crashlytics.sh
97+
cd ..
98+
source scripts/test_spm.sh
8599
env:
86100
SAMPLE: Crashlytics
87-
# Works from the xcode UI but not from the xcodebuild command
88-
# - name: Build SwiftUI (watchOS)
89-
# run: |
90-
# cd crashlytics
91-
# ../scripts/install_prereqs/crashlytics.sh
92-
# xcodebuild \
93-
# -project CrashlyticsExample.xcodeproj \
94-
# -scheme 'CrashlyticsSwiftUIExample (watchOS)' \
95-
# -sdk watchos \
96-
# build \
97-
# CODE_SIGN_IDENTITY="" \
98-
# CODE_SIGNING_REQUIRED=NO \
99-
# CODE_SIGNING_ALLOWED=NO
100-
# env:
101-
# SAMPLE: Crashlytics
101+
DIR: crashlytics
102+
OS: watchOS
103+
DEVICE: Apple Watch Series 5 - 44mm
104+
SWIFT_DEFINES: ""
105+
TEST: false

.github/workflows/database.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,15 @@ jobs:
4848
SAMPLE: Database
4949
- name: Build SwiftUI
5050
run: |
51-
cd database
52-
../scripts/install_prereqs/database.sh
53-
cd DatabaseExampleSwiftUI/DatabaseExample/
54-
xcodebuild \
55-
-project DatabaseExample.xcodeproj \
56-
-scheme 'DatabaseExample (iOS)' \
57-
-sdk iphonesimulator \
58-
-destination 'platform=iOS Simulator,name=iPhone 11' \
59-
build
51+
cd scripts
52+
source install_prereqs/database.sh
53+
cd ..
54+
source scripts/test_spm.sh
6055
env:
6156
SAMPLE: Database
57+
DIR: database/DatabaseExampleSwiftUI/DatabaseExample
58+
OS: iOS
59+
DEVICE: iPhone 11
60+
SWIFT_DEFINES: ""
61+
TEST: false
62+
secrets_passphrase: ${{ secrets.GHASECRETSGPGPASSPHRASE1 }}

.github/workflows/performance.yml

Lines changed: 12 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -51,65 +51,29 @@ jobs:
5151
SAMPLE: Performance
5252
- name: Build and Test SwiftUI iOS
5353
run: |
54-
set -io pipefail
55-
EXIT_STATUS=0
56-
source scripts/check_secrets.sh
57-
if [[ "$have_secrets" == true ]]; then
58-
(xcodebuild \
59-
-project "${DIR}/${SAMPLE}Example.xcodeproj" \
60-
-scheme "${SAMPLE}Example (${OS})" \
61-
-sdk "${SDK}simulator" \
62-
-destination "platform=${OS} Simulator,name=${DEVICE}" \
63-
build \
64-
test \
65-
| xcpretty) || EXIT_STATUS=$?
66-
else
67-
(xcodebuild \
68-
-project "${DIR}/${SAMPLE}Example.xcodeproj" \
69-
-scheme "${SAMPLE}Example (${OS})" \
70-
-sdk "${SDK}simulator" \
71-
-destination "platform=${OS} Simulator,name=${DEVICE}" \
72-
build \
73-
| xcpretty) || EXIT_STATUS=$?
74-
echo "Missing secrets: tests did not run."
75-
fi
76-
exit $EXIT_STATUS
54+
cd scripts
55+
source install_prereqs/abtesting.sh
56+
cd ..
57+
source scripts/test_spm.sh
7758
env:
7859
SAMPLE: Performance
7960
DIR: performance/SwiftUIPerformanceQuickstart/PerformanceExample
8061
OS: iOS
81-
SDK: iphone
8262
DEVICE: iPhone 11
63+
SWIFT_DEFINES: ""
64+
TEST: true
8365
secrets_passphrase: ${{ secrets.GHASECRETSGPGPASSPHRASE1 }}
8466
- name: Build and Test SwiftUI tvOS
8567
run: |
86-
set -io pipefail
87-
EXIT_STATUS=0
88-
source scripts/check_secrets.sh
89-
if [[ "$have_secrets" == true ]]; then
90-
(xcodebuild \
91-
-project "${DIR}/${SAMPLE}Example.xcodeproj" \
92-
-scheme "${SAMPLE}Example (${OS})" \
93-
-sdk "${SDK}simulator" \
94-
-destination "platform=${OS} Simulator,name=${DEVICE}" \
95-
build \
96-
test \
97-
| xcpretty) || EXIT_STATUS=$?
98-
else
99-
(xcodebuild \
100-
-project "${DIR}/${SAMPLE}Example.xcodeproj" \
101-
-scheme "${SAMPLE}Example (${OS})" \
102-
-sdk "${SDK}simulator" \
103-
-destination "platform=${OS} Simulator,name=${DEVICE}" \
104-
build \
105-
| xcpretty) || EXIT_STATUS=$?
106-
echo "Missing secrets: tests did not run."
107-
fi
108-
exit $EXIT_STATUS
68+
cd scripts
69+
source install_prereqs/abtesting.sh
70+
cd ..
71+
source scripts/test_spm.sh
10972
env:
11073
SAMPLE: Performance
11174
DIR: performance/SwiftUIPerformanceQuickstart/PerformanceExample
11275
OS: tvOS
113-
SDK: appletv
11476
DEVICE: Apple TV
77+
SWIFT_DEFINES: ""
78+
TEST: true
11579
secrets_passphrase: ${{ secrets.GHASECRETSGPGPASSPHRASE1 }}

crashlytics/CrashlyticsExample.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@
836836
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
837837
SWIFT_VERSION = 5.0;
838838
TARGETED_DEVICE_FAMILY = 4;
839-
WATCHOS_DEPLOYMENT_TARGET = 7.4;
839+
WATCHOS_DEPLOYMENT_TARGET = 7.2;
840840
};
841841
name = Debug;
842842
};
@@ -867,7 +867,7 @@
867867
SKIP_INSTALL = YES;
868868
SWIFT_VERSION = 5.0;
869869
TARGETED_DEVICE_FAMILY = 4;
870-
WATCHOS_DEPLOYMENT_TARGET = 7.4;
870+
WATCHOS_DEPLOYMENT_TARGET = 7.2;
871871
};
872872
name = Release;
873873
};
@@ -904,7 +904,7 @@
904904
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
905905
SWIFT_VERSION = 5.0;
906906
TARGETED_DEVICE_FAMILY = 4;
907-
WATCHOS_DEPLOYMENT_TARGET = 7.4;
907+
WATCHOS_DEPLOYMENT_TARGET = 7.2;
908908
};
909909
name = Debug;
910910
};
@@ -939,7 +939,7 @@
939939
SKIP_INSTALL = YES;
940940
SWIFT_VERSION = 5.0;
941941
TARGETED_DEVICE_FAMILY = 4;
942-
WATCHOS_DEPLOYMENT_TARGET = 7.4;
942+
WATCHOS_DEPLOYMENT_TARGET = 7.2;
943943
};
944944
name = Release;
945945
};
@@ -975,7 +975,7 @@
975975
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
976976
SWIFT_VERSION = 5.0;
977977
TARGETED_DEVICE_FAMILY = 3;
978-
TVOS_DEPLOYMENT_TARGET = 14.5;
978+
TVOS_DEPLOYMENT_TARGET = 14.0;
979979
};
980980
name = Debug;
981981
};
@@ -1009,7 +1009,7 @@
10091009
SDKROOT = appletvos;
10101010
SWIFT_VERSION = 5.0;
10111011
TARGETED_DEVICE_FAMILY = 3;
1012-
TVOS_DEPLOYMENT_TARGET = 14.5;
1012+
TVOS_DEPLOYMENT_TARGET = 14.0;
10131013
};
10141014
name = Release;
10151015
};

crashlytics/CrashlyticsExample.xcodeproj/xcshareddata/xcschemes/CrashlyticsSwiftUIExample (iOS).xcscheme renamed to crashlytics/CrashlyticsExample.xcodeproj/xcshareddata/xcschemes/CrashlyticsExample (iOS).xcscheme

File renamed without changes.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1300"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "C73C89A426845908003E5C2C"
18+
BuildableName = "CrashlyticsSwiftUIExample.app"
19+
BlueprintName = "CrashlyticsSwiftUIExample (macOS)"
20+
ReferencedContainer = "container:CrashlyticsExample.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
<BuildableProductRunnable
44+
runnableDebuggingMode = "0">
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "C73C89A426845908003E5C2C"
48+
BuildableName = "CrashlyticsSwiftUIExample.app"
49+
BlueprintName = "CrashlyticsSwiftUIExample (macOS)"
50+
ReferencedContainer = "container:CrashlyticsExample.xcodeproj">
51+
</BuildableReference>
52+
</BuildableProductRunnable>
53+
</LaunchAction>
54+
<ProfileAction
55+
buildConfiguration = "Release"
56+
shouldUseLaunchSchemeArgsEnv = "YES"
57+
savedToolIdentifier = ""
58+
useCustomWorkingDirectory = "NO"
59+
debugDocumentVersioning = "YES">
60+
<BuildableProductRunnable
61+
runnableDebuggingMode = "0">
62+
<BuildableReference
63+
BuildableIdentifier = "primary"
64+
BlueprintIdentifier = "C73C89A426845908003E5C2C"
65+
BuildableName = "CrashlyticsSwiftUIExample.app"
66+
BlueprintName = "CrashlyticsSwiftUIExample (macOS)"
67+
ReferencedContainer = "container:CrashlyticsExample.xcodeproj">
68+
</BuildableReference>
69+
</BuildableProductRunnable>
70+
</ProfileAction>
71+
<AnalyzeAction
72+
buildConfiguration = "Debug">
73+
</AnalyzeAction>
74+
<ArchiveAction
75+
buildConfiguration = "Release"
76+
revealArchiveInOrganizer = "YES">
77+
</ArchiveAction>
78+
</Scheme>

0 commit comments

Comments
 (0)