瀏覽代碼

Update sample app for Firebase 7 and add build test to CI (#6949)

Paul Beusterien 5 年之前
父節點
當前提交
5dac2bf4df

+ 16 - 0
.github/workflows/segmentation.yml

@@ -61,3 +61,19 @@ jobs:
       run: |
         scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSegmentation.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}
         scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSegmentation.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}
+
+  segmentation-sample-build-test:
+    # Don't run on private repo unless it is a PR.
+    if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    runs-on: macos-latest
+    steps:
+    - uses: actions/checkout@v2
+    - name: Setup Bundler
+      run: scripts/setup_bundler.sh
+    - name: Install Secret GoogleService-Info.plist
+      # Just copy a dummy plist for a build-only test
+      run: cp FirebaseCore/Tests/Unit/Resources/GoogleService-Info.plist FirebaseSegmentation/Tests/Sample/
+    - name: Prereqs
+      run: scripts/install_prereqs.sh SegmentationSample iOS
+    - name: Build
+      run: scripts/build.sh SegmentationSample iOS

+ 4 - 1
FirebaseSegmentation/Tests/Sample/Podfile

@@ -6,10 +6,13 @@ target 'SegmentationSampleApp' do
   # Comment the next line if you don't want to use dynamic frameworks
   use_frameworks!
   inherit! :search_paths
-  platform :ios, '8.0'
+  platform :ios, '10.0'
 
   # Pods for SegmentationSampleApp
   pod 'FirebaseCore', :path => '../../../'
+  pod 'FirebaseInstallations', :path => '../../../'
   pod 'FirebaseSegmentation', :path => '../../../'
+  pod 'GoogleDataTransport', :path => '../../../'
+  pod 'GoogleUtilities', :path => '../../../'
 
 end

+ 2 - 8
FirebaseSegmentation/Tests/Sample/SegmentationSampleApp.xcodeproj/project.pbxproj

@@ -31,11 +31,8 @@
 		5B4DE0B022F8D7B300B55A7B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
 		5B4DE0B222F8D7B300B55A7B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		5B4DE0B322F8D7B300B55A7B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
-		5B4DE0BA22F8DA1200B55A7B /* SecondApp-GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SecondApp-GoogleService-Info.plist"; sourceTree = "<group>"; };
 		5B4DE0BB22F8DA1300B55A7B /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
 		5B4DE0BF22F8E07200B55A7B /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../../../../configdaily googservice/GoogleService-Info.plist"; sourceTree = "<group>"; };
-		5B4DE0C222F8E09900B55A7B /* SecondApp-GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SecondApp-GoogleService-Info.plist"; sourceTree = "<group>"; };
-		5B4DE0C322F8E09900B55A7B /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -72,9 +69,6 @@
 			isa = PBXGroup;
 			children = (
 				5B4DE0BB22F8DA1300B55A7B /* GoogleService-Info.plist */,
-				5B4DE0C322F8E09900B55A7B /* GoogleService-Info.plist */,
-				5B4DE0BA22F8DA1200B55A7B /* SecondApp-GoogleService-Info.plist */,
-				5B4DE0C222F8E09900B55A7B /* SecondApp-GoogleService-Info.plist */,
 				5B4DE0A322F8D7B100B55A7B /* SegmentationSampleApp */,
 				5B4DE0A222F8D7B100B55A7B /* Products */,
 				1DAAA9CDE17A7AD3D4D58BFA /* Pods */,
@@ -373,7 +367,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.config.testapp.dev;
+				PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.paul.hackweek.nov2020;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "Firebase Remote Config TestApp Dev";
 				TARGETED_DEVICE_FAMILY = "1,2";
@@ -392,7 +386,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.config.testapp.dev;
+				PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.paul.hackweek.nov2020;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "Firebase Remote Config TestApp Dev";
 				TARGETED_DEVICE_FAMILY = "1,2";

+ 8 - 0
scripts/build.sh

@@ -394,6 +394,14 @@ case "$product-$platform-$method" in
     fi
     ;;
 
+  SegmentationSample-*-*)
+    RunXcodebuild \
+      -workspace 'FirebaseSegmentation/Tests/Sample/SegmentationSampleApp.xcworkspace' \
+      -scheme "SegmentationSampleApp" \
+      "${xcb_flags[@]}" \
+      build
+    ;;
+
   Database-*-unit)
     pod_gen FirebaseDatabase.podspec --platforms="${gen_platform}"
     RunXcodebuild \

+ 5 - 0
scripts/install_prereqs.sh

@@ -144,6 +144,11 @@ case "$project-$platform-$method" in
     bundle exec pod install --project-directory=FirebaseRemoteConfig/Tests/Sample --repo-update
     ;;
 
+  SegmentationSample-*)
+    install_xcpretty
+    bundle exec pod install --project-directory=FirebaseSegmentation/Tests/Sample --repo-update
+    ;;
+
   GoogleDataTransport-watchOS-xcodebuild)
     install_xcpretty
     bundle exec pod install --project-directory=GoogleDataTransport/GDTWatchOSTestApp/ --repo-update