aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Paul Beusterien <paulbeusterien@google.com>2018-05-09 19:23:38 -0700
committerGravatar GitHub <noreply@github.com>2018-05-09 19:23:38 -0700
commit53b866443995ed8e796246d1f22a6fe47f76be6b (patch)
tree897042336f2e4df0ec77cf95711946c95c301990
parentfb6f930f7beea29129cea89896d8ab874316ecbe (diff)
Add back pod spec lint checking (#1252)
* Add back pod spec lint checking * Separate pod lib lint to stages * order unit tests before lints * add lint to install_prereqs and remove default * consolidate pod_install and install_prereqs scripts * workaround travis 10 minute timeout for Firestore lint
-rw-r--r--.travis.yml47
-rwxr-xr-xscripts/if_changed.sh2
-rwxr-xr-xscripts/install_prereqs.sh34
-rwxr-xr-xscripts/pod_install.sh54
4 files changed, 52 insertions, 85 deletions
diff --git a/.travis.yml b/.travis.yml
index 1225b45..64e94d0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -27,35 +27,47 @@ jobs:
# Primary platforms
+ # Run unit tests
- stage: test
env:
- - PROJECT=Firebase PLATFORM=iOS
+ - PROJECT=Firebase PLATFORM=iOS METHOD=xcodebuild
before_install:
- npm install ios-sim -g
- ios-sim start --devicetypeid "com.apple.CoreSimulator.SimDeviceType.iPhone-7, 11.3"
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
- - ./scripts/if_changed.sh ./scripts/pod_install.sh
script:
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
- - ./scripts/if_changed.sh bundle exec pod lib lint FirebaseCore.podspec
-
- # TODO - Uncomment subsequent lines once FirebaseCore source repo is in public Specs repo
- # - bundle exec pod lib lint FirebaseAuth.podspec
- # - bundle exec pod lib lint FirebaseDatabase.podspec
- # - bundle exec pod lib lint FirebaseMessaging.podspec
- # - bundle exec pod lib lint FirebaseStorage.podspec
- # - bundle exec pod lib lint FirebaseFirestore.podspec
-
- stage: test
env:
- PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild
before_install:
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
- - ./scripts/if_changed.sh ./scripts/pod_install.sh
script:
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
+ # pod lib lint to check build and warnings
+ - stage: test
+ env:
+ - PROJECT=Firebase PLATFORM=iOS METHOD=pod-lib-lint
+ before_install:
+ - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
+ script:
+ - ./scripts/if_changed.sh bundle exec pod lib lint FirebaseCore.podspec
+ - ./scripts/if_changed.sh bundle exec pod lib lint FirebaseAuth.podspec
+ - ./scripts/if_changed.sh bundle exec pod lib lint FirebaseDatabase.podspec
+ - ./scripts/if_changed.sh bundle exec pod lib lint FirebaseMessaging.podspec
+ - ./scripts/if_changed.sh bundle exec pod lib lint FirebaseStorage.podspec
+ - ./scripts/if_changed.sh bundle exec pod lib lint FirebaseFunctions.podspec
+
+ - stage: test
+ env:
+ - PROJECT=Firestore PLATFORM=iOS METHOD=pod-lib-lint
+ before_install:
+ - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
+ script:
+ - travis_wait ./scripts/if_changed.sh bundle exec pod lib lint FirebaseFirestore.podspec --allow-warnings
+
# Alternative platforms
- stage: test
@@ -63,7 +75,6 @@ jobs:
- PROJECT=Firestore PLATFORM=macOS METHOD=cmake
before_install:
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
- - ./scripts/if_changed.sh ./scripts/pod_install.sh
script:
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
@@ -71,19 +82,17 @@ jobs:
- stage: test
env:
- - PROJECT=Firebase PLATFORM=macOS
+ - PROJECT=Firebase PLATFORM=macOS METHOD=xcodebuild
before_install:
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
- - ./scripts/if_changed.sh ./scripts/pod_install.sh
script:
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
- stage: test
env:
- - PROJECT=Firebase PLATFORM=tvOS
+ - PROJECT=Firebase PLATFORM=tvOS METHOD=xcodebuild
before_install:
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
- - ./scripts/if_changed.sh ./scripts/pod_install.sh
script:
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
@@ -94,7 +103,6 @@ jobs:
- PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild SANITIZERS=asan
before_install:
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
- - ./scripts/if_changed.sh ./scripts/pod_install.sh
script:
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
@@ -103,7 +111,6 @@ jobs:
- PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild SANITIZERS=tsan
before_install:
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
- - ./scripts/if_changed.sh ./scripts/pod_install.sh
script:
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
@@ -116,7 +123,6 @@ jobs:
- PROJECT=Firestore PLATFORM=macOS METHOD=cmake SANITIZERS=asan
before_install:
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
- - ./scripts/if_changed.sh ./scripts/pod_install.sh
script:
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
@@ -125,7 +131,6 @@ jobs:
- PROJECT=Firestore PLATFORM=macOS METHOD=cmake SANITIZERS=tsan
before_install:
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
- - ./scripts/if_changed.sh ./scripts/pod_install.sh
script:
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
diff --git a/scripts/if_changed.sh b/scripts/if_changed.sh
index 697cad2..3bc2a65 100755
--- a/scripts/if_changed.sh
+++ b/scripts/if_changed.sh
@@ -49,7 +49,7 @@ else
check_changes '^(Firebase|Functions|Example)'
;;
- Firestore-xcodebuild)
+ Firestore-xcodebuild|Firestore-pod-lib-lint)
check_changes '^Firestore'
;;
diff --git a/scripts/install_prereqs.sh b/scripts/install_prereqs.sh
index c86663f..c943369 100755
--- a/scripts/install_prereqs.sh
+++ b/scripts/install_prereqs.sh
@@ -19,28 +19,44 @@
# - PROJECT - Firebase or Firestore
# - METHOD - xcodebuild or cmake; default is xcodebuild
-if [[ -z "$METHOD" ]]; then
- METHOD="xcodebuild"
-fi
+bundle install
-case "$PROJECT-$METHOD" in
- *-xcodebuild)
- bundle install
+case "$PROJECT-$PLATFORM-$METHOD" in
+ Firebase-iOS-xcodebuild)
gem install xcpretty
+ bundle exec pod install --project-directory=Example --repo-update
+ bundle exec pod install --project-directory=Functions/Example
;;
- Firestore-cmake)
- bundle install
+ Firebase-*-xcodebuild)
+ gem install xcpretty
+ bundle exec pod install --project-directory=Example --repo-update
+ ;;
+
+ Firestore-*-xcodebuild)
+ gem install xcpretty
+ bundle exec pod install --project-directory=Firestore/Example --repo-update
+ ;;
+
+ *-pod-lib-lint)
+ bundle exec pod repo update
+ ;;
+
+ Firestore-*-cmake)
# xcpretty is helpful for the intermediate step which builds FirebaseCore
# using xcodebuild.
gem install xcpretty
brew outdated cmake || brew upgrade cmake
brew outdated go || brew upgrade go # Somehow the build for Abseil requires this.
+ bundle exec pod install --project-directory=Example --repo-update
+ bundle exec pod install --project-directory=Firestore/Example \
+ --no-repo-update
;;
*)
- echo "Unknown project-method combo" 1>&2
+ echo "Unknown project-platform-method combo" 1>&2
echo " PROJECT=$PROJECT" 1>&2
+ echo " PLATFORM=$PLATFORM" 1>&2
echo " METHOD=$METHOD" 1>&2
exit 1
;;
diff --git a/scripts/pod_install.sh b/scripts/pod_install.sh
deleted file mode 100755
index ff5ec96..0000000
--- a/scripts/pod_install.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 2018 Google
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Within Travis, installs prerequisites for a build.
-
-# Examines the following configured environment variables that should be
-# specified in an env: block
-# - PROJECT - Firebase or Firestore
-# - METHOD - xcodebuild or cmake; default is xcodebuild
-# - PLATFORM - iOS, macOS, or tvOS
-
-if [[ -z "$METHOD" ]]; then
- METHOD="xcodebuild"
-fi
-
-case "$PROJECT-$METHOD-$PLATFORM" in
- Firebase-xcodebuild-iOS)
- bundle exec pod install --project-directory=Example --repo-update
- bundle exec pod install --project-directory=Functions/Example
- ;;
-
- Firebase-xcodebuild-*)
- bundle exec pod install --project-directory=Example --repo-update
- ;;
-
- Firestore-xcodebuild-*)
- bundle exec pod install --project-directory=Firestore/Example --repo-update
- ;;
-
- Firestore-cmake-*)
- bundle exec pod install --project-directory=Example --repo-update
- bundle exec pod install --project-directory=Firestore/Example \
- --no-repo-update
- ;;
-
- *)
- echo "Unknown project-method combo" 1>&2
- echo " PROJECT=$PROJECT" 1>&2
- echo " METHOD=$METHOD" 1>&2
- exit 1
- ;;
-esac
-