Skip to content

Commit

Permalink
Merge pull request #50 from sharplet/wider-ci
Browse files Browse the repository at this point in the history
Revisit travis build matrix
  • Loading branch information
sharplet authored Jun 13, 2017
2 parents 8dc3bdc + 24c0bbc commit 33e731a
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 128 deletions.
32 changes: 27 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
language: objective-c
osx_image: xcode8.3
install:
- gem install xcpretty
- rake setup
cache:
directories:
- Carthage
matrix:
include:
- env: ACTION=test:osx
install:
- gem install xcpretty
- rake setup PLATFORM=macOS
- env: ACTION=test:ios
install:
- gem install xcpretty
- rake setup PLATFORM=iOS
- env: ACTION=test:tvos
- env: ACTION=test:watchos
- env: ACTION=build:all
install:
- gem install xcpretty
- rake setup PLATFORM=tvOS
- env: ACTION=build:carthage:ios
- env: ACTION=build:carthage:macos
- env: ACTION=build:carthage:tvos
- env: ACTION=build:carthage:watchos
- env: ACTION=build:pod
- env: ACTION=build:package
- env: ACTION=test:package
- env: ACTION=test:package
os: linux
Expand All @@ -18,5 +31,14 @@ matrix:
dist: trusty
install:
- eval "$(cat bin/setup-swiftenv.bash)"
- bin/swiftenv-install
- env: ACTION=test:package
os: linux
language: generic
sudo: required
dist: trusty
install:
- eval "$(cat bin/setup-swiftenv.bash)"
- env SWIFT_VERSION=$(bin/latest-snapshot '^4.0') bin/swiftenv-install
fast_finish: true
script: rake "$ACTION"
33 changes: 16 additions & 17 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
require_relative "lib/suite_task"

desc "Set up the project for development"
task :setup do
sh "carthage bootstrap --no-build"
platform = ENV.fetch("PLATFORM", nil)
if platform
sh "carthage bootstrap --cache-builds --platform #{platform}"
else
sh "carthage bootstrap --cache-builds"
end
end

namespace :build do
desc "Build for all platforms"
suite :all => [:pod, :framework, :package]

desc "Build and validate the podspec"
task :pod do
sh "pod lib lint *.podspec --quick --no-clean"
end

desc "Build the framework"
task :framework do
sh "carthage build --no-skip-current"
namespace :carthage do
%w[iOS macOS tvOS watchOS].each do |platform|
desc "Build the Carthage framework on #{platform}"
task platform.downcase.to_sym do
sh "carthage build --platform #{platform} --no-skip-current"
end
end
end

desc "Build the Swift package"
Expand Down Expand Up @@ -49,22 +53,17 @@ namespace :test do

desc "Run tests on OS X"
task :osx do
pretty "xcodebuild build-for-testing test-without-building -workspace Regex.xcworkspace -scheme Regex-OSX"
pretty "xcodebuild build-for-testing test-without-building -project Regex.xcodeproj -scheme Regex-OSX"
end

desc "Run tests on iOS Simulator"
task :ios do
pretty "xcodebuild build-for-testing test-without-building -workspace Regex.xcworkspace -scheme Regex-iOS -destination 'platform=iOS Simulator,name=iPhone 6s'"
pretty "xcodebuild build-for-testing test-without-building -project Regex.xcodeproj -scheme Regex-iOS -destination 'platform=iOS Simulator,name=iPhone 6s'"
end

desc "Run tests on tvOS Simulator"
task :tvos do
pretty "xcodebuild build-for-testing test-without-building -workspace Regex.xcworkspace -scheme Regex-tvOS -destination 'platform=tvOS Simulator,name=Apple TV 1080p'"
end

desc "Build for watchOS Simulator"
task :watchos do
pretty "xcodebuild build -workspace Regex.xcworkspace -scheme Regex-watchOS -destination 'platform=watchOS Simulator,name=Apple Watch - 42mm'"
pretty "xcodebuild build-for-testing test-without-building -project Regex.xcodeproj -scheme Regex-tvOS -destination 'platform=tvOS Simulator,name=Apple TV 1080p'"
end

desc "Run the SwiftPM tests"
Expand Down
88 changes: 44 additions & 44 deletions Regex.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
objects = {

/* Begin PBXBuildFile section */
4A2BB5531EF0489E000A32F2 /* Nimble.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4A8249751EF0445600002E42 /* Nimble.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4A2BB5541EF0489E000A32F2 /* Quick.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4A8249761EF0445600002E42 /* Quick.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4A2BB5551EF048A6000A32F2 /* Nimble.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4A8249711EF0444A00002E42 /* Nimble.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4A2BB5561EF048A6000A32F2 /* Quick.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4A8249721EF0444A00002E42 /* Quick.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4A2BB5571EF048AE000A32F2 /* Nimble.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4A82496D1EF0442E00002E42 /* Nimble.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4A2BB5581EF048AE000A32F2 /* Quick.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4A82496E1EF0442E00002E42 /* Quick.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4A698B931E130A6C006951B2 /* OptionsSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A698B871E130A60006951B2 /* OptionsSpec.swift */; };
4A698B941E130A6C006951B2 /* RegexSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A698B881E130A60006951B2 /* RegexSpec.swift */; };
4A698B951E130A6C006951B2 /* StringReplacementSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A698B891E130A60006951B2 /* StringReplacementSpec.swift */; };
Expand All @@ -16,18 +22,12 @@
4A698B991E130A6E006951B2 /* OptionsSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A698B871E130A60006951B2 /* OptionsSpec.swift */; };
4A698B9A1E130A6E006951B2 /* RegexSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A698B881E130A60006951B2 /* RegexSpec.swift */; };
4A698B9B1E130A6E006951B2 /* StringReplacementSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A698B891E130A60006951B2 /* StringReplacementSpec.swift */; };
4A6BF6FE1CD555880081B164 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A6BF6FC1CD555880081B164 /* Nimble.framework */; };
4A6BF6FF1CD555880081B164 /* Quick.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A6BF6FD1CD555880081B164 /* Quick.framework */; };
4A6BF7001CD555C20081B164 /* Nimble.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4A6BF6FC1CD555880081B164 /* Nimble.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4A6BF7011CD555C50081B164 /* Quick.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4A6BF6FD1CD555880081B164 /* Quick.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4A6BF7041CD5570A0081B164 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A6BF7021CD5570A0081B164 /* Nimble.framework */; };
4A6BF7051CD5570A0081B164 /* Quick.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A6BF7031CD5570A0081B164 /* Quick.framework */; };
4A6BF7061CD557510081B164 /* Nimble.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4A6BF7021CD5570A0081B164 /* Nimble.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4A6BF7071CD557510081B164 /* Quick.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4A6BF7031CD5570A0081B164 /* Quick.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4A6BF70A1CD557620081B164 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A6BF7081CD557620081B164 /* Nimble.framework */; };
4A6BF70B1CD557620081B164 /* Quick.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A6BF7091CD557620081B164 /* Quick.framework */; };
4A6BF70C1CD557910081B164 /* Nimble.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4A6BF7081CD557620081B164 /* Nimble.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4A6BF70D1CD557910081B164 /* Quick.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4A6BF7091CD557620081B164 /* Quick.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4A82496F1EF0442E00002E42 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A82496D1EF0442E00002E42 /* Nimble.framework */; };
4A8249701EF0442E00002E42 /* Quick.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A82496E1EF0442E00002E42 /* Quick.framework */; };
4A8249731EF0444A00002E42 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A8249711EF0444A00002E42 /* Nimble.framework */; };
4A8249741EF0444A00002E42 /* Quick.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A8249721EF0444A00002E42 /* Quick.framework */; };
4A8249771EF0445600002E42 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A8249751EF0445600002E42 /* Nimble.framework */; };
4A8249781EF0445600002E42 /* Quick.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A8249761EF0445600002E42 /* Quick.framework */; };
CE26D9EE1C34D96A003CFB54 /* ThreadLocal.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE26D9ED1C34D96A003CFB54 /* ThreadLocal.swift */; };
CE26D9EF1C34D96A003CFB54 /* ThreadLocal.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE26D9ED1C34D96A003CFB54 /* ThreadLocal.swift */; };
CE26D9F01C34D96A003CFB54 /* ThreadLocal.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE26D9ED1C34D96A003CFB54 /* ThreadLocal.swift */; };
Expand Down Expand Up @@ -92,8 +92,8 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
4A6BF7001CD555C20081B164 /* Nimble.framework in Embed Frameworks */,
4A6BF7011CD555C50081B164 /* Quick.framework in Embed Frameworks */,
4A2BB5551EF048A6000A32F2 /* Nimble.framework in Embed Frameworks */,
4A2BB5561EF048A6000A32F2 /* Quick.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -104,8 +104,8 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
4A6BF7061CD557510081B164 /* Nimble.framework in Embed Frameworks */,
4A6BF7071CD557510081B164 /* Quick.framework in Embed Frameworks */,
4A2BB5571EF048AE000A32F2 /* Nimble.framework in Embed Frameworks */,
4A2BB5581EF048AE000A32F2 /* Quick.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -116,8 +116,8 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
4A6BF70C1CD557910081B164 /* Nimble.framework in Embed Frameworks */,
4A6BF70D1CD557910081B164 /* Quick.framework in Embed Frameworks */,
4A2BB5531EF0489E000A32F2 /* Nimble.framework in Embed Frameworks */,
4A2BB5541EF0489E000A32F2 /* Quick.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -130,12 +130,12 @@
4A698B881E130A60006951B2 /* RegexSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RegexSpec.swift; sourceTree = "<group>"; };
4A698B891E130A60006951B2 /* StringReplacementSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StringReplacementSpec.swift; sourceTree = "<group>"; };
4A698B9C1E130B17006951B2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = RegexTests/Info.plist; sourceTree = "<group>"; };
4A6BF6FC1CD555880081B164 /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Nimble.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4A6BF6FD1CD555880081B164 /* Quick.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Quick.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4A6BF7021CD5570A0081B164 /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Nimble.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4A6BF7031CD5570A0081B164 /* Quick.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Quick.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4A6BF7081CD557620081B164 /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Nimble.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4A6BF7091CD557620081B164 /* Quick.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Quick.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4A82496D1EF0442E00002E42 /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Nimble.framework; path = Carthage/Build/iOS/Nimble.framework; sourceTree = "<group>"; };
4A82496E1EF0442E00002E42 /* Quick.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quick.framework; path = Carthage/Build/iOS/Quick.framework; sourceTree = "<group>"; };
4A8249711EF0444A00002E42 /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Nimble.framework; path = Carthage/Build/Mac/Nimble.framework; sourceTree = "<group>"; };
4A8249721EF0444A00002E42 /* Quick.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quick.framework; path = Carthage/Build/Mac/Quick.framework; sourceTree = "<group>"; };
4A8249751EF0445600002E42 /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Nimble.framework; path = Carthage/Build/tvOS/Nimble.framework; sourceTree = "<group>"; };
4A8249761EF0445600002E42 /* Quick.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quick.framework; path = Carthage/Build/tvOS/Quick.framework; sourceTree = "<group>"; };
CE26D9ED1C34D96A003CFB54 /* ThreadLocal.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ThreadLocal.swift; sourceTree = "<group>"; };
CE4BE2961C1682CF005E4D4F /* Options.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Options.swift; sourceTree = "<group>"; };
CE6CDF601BE239DE00AE6393 /* Regex.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Regex.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -165,8 +165,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4A6BF7041CD5570A0081B164 /* Nimble.framework in Frameworks */,
4A6BF7051CD5570A0081B164 /* Quick.framework in Frameworks */,
4A82496F1EF0442E00002E42 /* Nimble.framework in Frameworks */,
4A8249701EF0442E00002E42 /* Quick.framework in Frameworks */,
CE6CDF6B1BE239DE00AE6393 /* Regex.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -182,8 +182,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4A6BF6FE1CD555880081B164 /* Nimble.framework in Frameworks */,
4A6BF6FF1CD555880081B164 /* Quick.framework in Frameworks */,
4A8249731EF0444A00002E42 /* Nimble.framework in Frameworks */,
4A8249741EF0444A00002E42 /* Quick.framework in Frameworks */,
CEC768731BE99A050066BA1E /* Regex.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -206,8 +206,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4A6BF70A1CD557620081B164 /* Nimble.framework in Frameworks */,
4A6BF70B1CD557620081B164 /* Quick.framework in Frameworks */,
4A8249771EF0445600002E42 /* Nimble.framework in Frameworks */,
4A8249781EF0445600002E42 /* Quick.framework in Frameworks */,
CED611E01C2A2C2E008D212A /* Regex.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -234,13 +234,26 @@
path = RegexTests;
sourceTree = "<group>";
};
4A82496C1EF0442E00002E42 /* Frameworks */ = {
isa = PBXGroup;
children = (
4A8249751EF0445600002E42 /* Nimble.framework */,
4A8249761EF0445600002E42 /* Quick.framework */,
4A8249711EF0444A00002E42 /* Nimble.framework */,
4A8249721EF0444A00002E42 /* Quick.framework */,
4A82496D1EF0442E00002E42 /* Nimble.framework */,
4A82496E1EF0442E00002E42 /* Quick.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
CE6CDF561BE239DE00AE6393 = {
isa = PBXGroup;
children = (
CE6CDF621BE239DE00AE6393 /* Source */,
CE6CDF6E1BE239DE00AE6393 /* Tests */,
05A5B69C1C5EDD3C00097E4A /* Config */,
CE6CDF7C1BE23A6400AE6393 /* Frameworks */,
4A82496C1EF0442E00002E42 /* Frameworks */,
CE6CDF611BE239DE00AE6393 /* Products */,
);
sourceTree = "<group>";
Expand Down Expand Up @@ -299,19 +312,6 @@
path = ..;
sourceTree = "<group>";
};
CE6CDF7C1BE23A6400AE6393 /* Frameworks */ = {
isa = PBXGroup;
children = (
4A6BF7081CD557620081B164 /* Nimble.framework */,
4A6BF7091CD557620081B164 /* Quick.framework */,
4A6BF7021CD5570A0081B164 /* Nimble.framework */,
4A6BF7031CD5570A0081B164 /* Quick.framework */,
4A6BF6FC1CD555880081B164 /* Nimble.framework */,
4A6BF6FD1CD555880081B164 /* Quick.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
Expand Down
13 changes: 0 additions & 13 deletions Regex.xcworkspace/contents.xcworkspacedata

This file was deleted.

8 changes: 0 additions & 8 deletions Regex.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings

This file was deleted.

10 changes: 10 additions & 0 deletions bin/latest-snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

set -e
set -o pipefail

if [ $# = 1 ]; then
swiftenv install --list-snapshots 2>/dev/null | grep "$1" | tail -1
else
swiftenv install --list-snapshots 2>/dev/null | tail -1
fi
6 changes: 0 additions & 6 deletions bin/setup-swiftenv.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,3 @@
git clone --depth 1 https://github.com/kylef/swiftenv.git ~/.swiftenv
export SWIFTENV_ROOT="$HOME/.swiftenv"
export PATH="$SWIFTENV_ROOT/bin:$SWIFTENV_ROOT/shims:$PATH"

if [ -f ".swift-version" ] || [ -n "$SWIFT_VERSION" ]; then
swiftenv install -s
else
swiftenv rehash
fi
7 changes: 7 additions & 0 deletions bin/swiftenv-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

if [ -f ".swift-version" ] || [ -n "$SWIFT_VERSION" ]; then
swiftenv install -s
else
swiftenv rehash
fi
35 changes: 0 additions & 35 deletions lib/suite_task.rb

This file was deleted.

0 comments on commit 33e731a

Please sign in to comment.