Skip to content

Commit

Permalink
Add circle.yml for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
endocrimes committed May 15, 2017
1 parent e0bb44c commit ecdfccf
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 8 deletions.
43 changes: 43 additions & 0 deletions .circle-scripts/fetch-cocoapods-repo-from-s3.sh
@@ -0,0 +1,43 @@
#!/usr/bin/env bash

set -o nounset
set -o errexit
set -o pipefail

REPOS_LOCATION="$HOME/.cocoapods/repos"
MASTER_REPO_LOCATION="$REPOS_LOCATION/master"
S3_BUCKET="cocoapods-specs"

tempfile=$(mktemp)

cleanup() {
echo "Download from S3 failed, cleaning up and falling back to standard checkout..."
rm -rf "$MASTER_REPO_LOCATION"
rm "$tempfile"
}

trap cleanup ERR

# Only install awscli if it's not in the image. pip will exit with
# non-zero exit code if the package is not installed. Hiding all output
# from package installation to not to confuse users.
if ! pip show awscli > /dev/null 2>&1 ; then
sudo pip install --ignore-installed awscli > /dev/null 2>&1
fi

rm -rf "$MASTER_REPO_LOCATION"
mkdir -p "$REPOS_LOCATION"

echo "Downloading CocoaPods master repo from $S3_BUCKET S3 bucket..."
# --no-sign-request forces awscli to not to use any credentials.
aws s3 --no-sign-request cp "s3://$S3_BUCKET/latest.tar.gz" "$tempfile" > /dev/null

echo "Uncompressing CocoaPods master repo..."
# We expect the structure with the "master" as the top dir in the archive.
tar -C "$REPOS_LOCATION" -xzf "$tempfile"

echo "Successfully downloaded CocoaPods master repo."
COCOAPODS_GIT_REV="$(cd $MASTER_REPO_LOCATION && git rev-parse HEAD)"
echo "Using specs repo revision $COCOAPODS_GIT_REV."

rm "$tempfile"
4 changes: 0 additions & 4 deletions .travis.yml
Expand Up @@ -8,10 +8,6 @@ git:

matrix:
include:
- rvm: system
env: COCOAPODS_CI_TASKS=EXAMPLES
osx_image: xcode7.3
language: objective-c
- rvm: 2.4.0
env: COCOAPODS_CI_TASKS=LINT
git:
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -36,6 +36,7 @@ group :development do
cp_gem 'molinillo', 'Molinillo'
cp_gem 'nanaimo', 'Nanaimo'
cp_gem 'xcodeproj', 'Xcodeproj'
cp_gem 'fourflusher', 'Fourflusher'

gem 'cocoapods-dependencies', '~> 1.0.beta.1'

Expand Down
9 changes: 8 additions & 1 deletion Gemfile.lock
Expand Up @@ -15,6 +15,13 @@ GIT
fuzzy_match (~> 2.0.4)
nap (~> 1.0)

GIT
remote: https://github.com/CocoaPods/Fourflusher.git
revision: 286949079bad4d760f8646601c91bc5f99137fe8
branch: master
specs:
fourflusher (2.0.1)

GIT
remote: https://github.com/CocoaPods/Molinillo.git
revision: c2f655cd697812574a8537cc7c9cf68a0c0357b3
Expand Down Expand Up @@ -171,7 +178,6 @@ GEM
faraday-http-cache (1.3.0)
faraday (~> 0.8)
ffi (1.9.6)
fourflusher (2.0.1)
fuzzy_match (2.0.4)
gh_inspector (1.0.3)
git (1.3.0)
Expand Down Expand Up @@ -275,6 +281,7 @@ DEPENDENCIES
cocoapods_debug
danger
diffy
fourflusher!
inch_by_inch
json!
kicker
Expand Down
6 changes: 3 additions & 3 deletions Rakefile
Expand Up @@ -295,10 +295,10 @@ begin
when :osx
execute_command "xcodebuild -workspace '#{workspace_path}' -scheme '#{scheme_name}' clean build"
when :ios
# Specifically build against the simulator SDK so we don't have to deal with code signing.
# Need to use the iPhone 6s, since this is the default simulator paired with a watch in Xcode 7.3
test_flag = (scheme_name.start_with? 'Test') ? 'test' : ''
execute_command "xcodebuild -workspace '#{workspace_path}' -scheme '#{scheme_name}' clean build #{test_flag} ONLY_ACTIVE_ARCH=NO -destination 'platform=iOS Simulator,name=iPhone 6s'"
watch_project = scheme_name.start_with? 'watchOS'

execute_command "xcodebuild -workspace '#{workspace_path}' -scheme '#{scheme_name}' clean build #{test_flag} ONLY_ACTIVE_ARCH=NO -destination 'platform=iOS Simulator,name=iPhone 7'"
else
raise "Unknown platform #{platform}"
end
Expand Down
23 changes: 23 additions & 0 deletions circle.yml
@@ -0,0 +1,23 @@
machine:
ruby:
version: system
xcode:
version: "8.3.2"

dependencies:
override:
- sudo gem update --system
- bundle check || bundle install --path .bundle
- .circle-scripts/fetch-cocoapods-repo-from-s3.sh
cache_directories:
- .bundle

test:
pre:
- git config --global user.email "tests@cocoapods.org"
- git config --global user.name "CocoaPods Tests"
- bundle exec pod env
override:
- bundle exec rake spec:all:
environment:
COCOAPODS_CI_TASKS: EXAMPLES

0 comments on commit ecdfccf

Please sign in to comment.