Skip to content

Commit

Permalink
Merge pull request #2 from kishikawakatsumi/travis_ci
Browse files Browse the repository at this point in the history
Running tests on Travis CI
  • Loading branch information
kishikawakatsumi committed May 13, 2017
2 parents 412fe60 + 4271e49 commit f4f8636
Show file tree
Hide file tree
Showing 12 changed files with 153 additions and 99 deletions.
76 changes: 58 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,69 @@ language: objective-c
osx_image: xcode8.3
cache:
directories:
- Lib/vendor/bundle
- vendor
before_install:
- brew update
- brew outdated carthage || brew upgrade carthage
- brew update
- brew outdated carthage || brew upgrade carthage
install:
- bundle install --path=vendor/bundle --binstubs=vendor/bin
- bundle install --path=vendor/bundle --binstubs=vendor/bin
script:
- travis_wait 40 ruby cmd.rb bundle exec rake "$ACTION"
- bundle exec rake "$ACTION" CONFIGURATION="Debug" DESTINATION="$DESTINATION" TESTCASE="$TESTCASE" coverage:coveralls
coverage:coveralls
branches:
only:
- master
- master
env:
matrix:
- ACTION='test:iphonesimulator[Debug,iPhone-4s,9.3] coverage:coveralls'
- ACTION='test:iphonesimulator[Debug,iPhone 5,9.3] coverage:coveralls'
# - ACTION='test:iphonesimulator[Debug,iPhone 5s,10.2] coverage:coveralls'
- ACTION='test:iphonesimulator[Debug,iPhone 6s,10.2] coverage:coveralls'
- ACTION='test:iphonesimulator[Debug,iPhone 6s Plus,10.2] coverage:coveralls'
# - ACTION='test:iphonesimulator[Debug,iPhone SE,10.2] coverage:coveralls'
# - ACTION='test:iphonesimulator[Debug,iPad Pro2,9.3] coverage:coveralls'
# - ACTION='test:iphonesimulator[Debug,iPad Air 2,10.2] coverage:coveralls'
# - ACTION='test:iphonesimulator[Debug,iPad Pro (9.7-inch),10.2] coverage:coveralls'
- ACTION='test:iphonesimulator[Debug,iPad Pro (12.9-inch),10.2] coverage:coveralls'
- ACTION=test:iphonesimulator DESTINATION='name=iPhone 4s,OS=9.3'
- ACTION=test:iphonesimulator DESTINATION='name=iPhone 5,OS=9.3'
- ACTION=test:iphonesimulator DESTINATION='name=iPhone 6s,OS=10.3' TESTCASE='MergedCellTests'
- ACTION=test:iphonesimulator DESTINATION='name=iPhone 6s,OS=10.3' TESTCASE='ScrollTests'
- ACTION=test:iphonesimulator DESTINATION='name=iPhone 6s,OS=10.3' TESTCASE='SelectionTests'
- ACTION=test:iphonesimulator DESTINATION='name=iPhone 7 Plus,OS=10.3' TESTCASE='MergedCellTests'
- ACTION=test:iphonesimulator DESTINATION='name=iPhone 7 Plus,OS=10.3' TESTCASE='ScrollTests'
- ACTION=test:iphonesimulator DESTINATION='name=iPhone 7 Plus,OS=10.3' TESTCASE='SelectionTests'
- ACTION=test:iphonesimulator DESTINATION='name=iPad 2,OS=9.3' TESTCASE='MergedCellTests'
- ACTION=test:iphonesimulator DESTINATION='name=iPad 2,OS=9.3' TESTCASE='ScrollTests/testTableViewScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad 2,OS=9.3' TESTCASE='ScrollTests/testColumnHeaderViewScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad 2,OS=9.3' TESTCASE='ScrollTests/testRowHeaderViewScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad 2,OS=9.3' TESTCASE='ScrollTests/testColumnAndRowHeaderViewScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad 2,OS=9.3' TESTCASE='ScrollTests/testCircularScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad 2,OS=9.3' TESTCASE='SelectionTests'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Air 2,OS=10.3' TESTCASE='MergedCellTests'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Air 2,OS=10.3' TESTCASE='ScrollTests/testTableViewScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Air 2,OS=10.3' TESTCASE='ScrollTests/testColumnHeaderViewScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Air 2,OS=10.3' TESTCASE='ScrollTests/testRowHeaderViewScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Air 2,OS=10.3' TESTCASE='ScrollTests/testColumnAndRowHeaderViewScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Air 2,OS=10.3' TESTCASE='ScrollTests/testCircularScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Air 2,OS=10.3' TESTCASE='SelectionTests'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Pro (9.7-inch),OS=10.3' TESTCASE='MergedCellTests'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Pro (9.7-inch),OS=10.3' TESTCASE='ScrollTests/testTableViewScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Pro (9.7-inch),OS=10.3' TESTCASE='ScrollTests/testColumnHeaderViewScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Pro (9.7-inch),OS=10.3' TESTCASE='ScrollTests/testRowHeaderViewScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Pro (9.7-inch),OS=10.3' TESTCASE='ScrollTests/testColumnAndRowHeaderViewScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Pro (9.7-inch),OS=10.3' TESTCASE='ScrollTests/testCircularScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Pro (9.7-inch),OS=10.3' TESTCASE='SelectionTests'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Pro (12.9-inch),OS=10.3' TESTCASE='MergedCellTests'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Pro (12.9-inch),OS=10.3' TESTCASE='ScrollTests/testTableViewScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Pro (12.9-inch),OS=10.3' TESTCASE='ScrollTests/testColumnHeaderViewScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Pro (12.9-inch),OS=10.3' TESTCASE='ScrollTests/testRowHeaderViewScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Pro (12.9-inch),OS=10.3' TESTCASE='ScrollTests/testColumnAndRowHeaderViewScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Pro (12.9-inch),OS=10.3' TESTCASE='ScrollTests/testCircularScrolling'
- ACTION=test:iphonesimulator DESTINATION='name=iPad Pro (12.9-inch),OS=10.3' TESTCASE='SelectionTests'
global:
- LANG=en_US.UTF-8
- LC_ALL=en_US.UTF-8
- LANG=en_US.UTF-8
- LC_ALL=en_US.UTF-8
- FRAMEWORK_NAME=SpreadsheetView
before_deploy:
- carthage build --no-skip-current
- carthage archive $FRAMEWORK_NAME
deploy:
provider: releases
api_key:
secure: ahHhvdknIX8RMoEp5SbjHPelCtkFhEfSOZHc9Ty9FeuA6iFrJNqls17vip3f1R5UgR7AAjzfFaIxrY+xa7/tasje1HZE7az1df6jEzCqoM6U7Ot50uoDcZcfk/MsbtJ6ufj8/C7aUNtO3ELrqAvLSQEelKx1epKlFGD8qph8Hm8xtazIp92YtK/T7snCoqLf7zTMfV/rbueDP29JY4S0hdRh6kbZyB7o83E1FO0qAlL5/BeRlSNVDtdB7b0Fn1XuQ7KCbsQulboomkTCTFLNKGkIqmSXelLFeaUJLr02zt/LT+jIyHNeGS7Cduc0z17LYhtfbIkVMs2VV9/hsvAmcwfbJtZK7eAupkCl+1YiUmbna/x9rS9MuL0+gUNtajA5vXey/jeuy17gDpIetX+Me6VNW5o2AcVnw6GXhdNPBTadfSai1C0Jb7Cru8cWdAniKH1jDfPjT3R5PEonfoX13dZrzuQfEh9wvO2UAufI1O7BCEfjx49k9NeM6nqpbTAap5pR1djAnuYFIJrN96vSdoZ/bbRVD+tM+xgt0WSJdD6Tbt0+J/45JvZJ1w6f9ytvA8KQJGJN/OsWBYKi80Rq6VmcRhUh0OyH9/hrb44AySYiTPGf6ol/pjE4O4EjZ/MboabIe8RandG/Ty4wZZbvzGT9fRuDLByr2jfNb3/X4F8=
file: "$FRAMEWORK_NAME.framework.zip"
skip_cleanup: true
on:
repo: kishikawakatsumi/SpreadsheetView
tags: true
9 changes: 9 additions & 0 deletions Framework/Sources/Location.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ public struct Location: Hashable {
public let row: Int
public let column: Int

init(row: Int, column: Int) {
self.row = row
self.column = column
}

init(indexPath: IndexPath) {
self.init(row: indexPath.row, column: indexPath.column)
}

public var hashValue: Int {
return 32768 * row + column
}
Expand Down
13 changes: 10 additions & 3 deletions Framework/Sources/SpreadsheetView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,15 @@ public class SpreadsheetView: UIView {
}

var contentOffset = CGPoint(x: columnRecords[indexPath.column], y: rowRecords[indexPath.row])
let width = layoutProperties.columnWidthCache[indexPath.column]
let height = layoutProperties.rowHeightCache[indexPath.row]
let width: CGFloat
let height: CGFloat
if let mergedCell = layoutProperties.mergedCellLayouts[Location(indexPath: indexPath)] {
width = (mergedCell.from.column...mergedCell.to.column).reduce(0) { $0 + layoutProperties.columnWidthCache[$1] } + intercellSpacing.width
height = (mergedCell.from.row...mergedCell.to.row).reduce(0) { $0 + layoutProperties.rowHeightCache[$1] } + intercellSpacing.height
} else {
width = layoutProperties.columnWidthCache[indexPath.column]
height = layoutProperties.rowHeightCache[indexPath.row]
}

if circularScrollingOptions.direction.contains(.horizontally) {
if contentOffset.x > centerOffset.x {
Expand Down Expand Up @@ -469,7 +476,7 @@ public class SpreadsheetView: UIView {
if !scrollPosition.isEmpty {
scrollToItem(at: indexPath, at: scrollPosition, animated: animated)
if animated {
pendingSelectionIndexPath?.append(indexPath)
pendingSelectionIndexPath = indexPath
return
}
}
Expand Down
8 changes: 2 additions & 6 deletions Framework/SpreadsheetView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -588,6 +589,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -611,7 +613,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.kishikawakatsumi.SpreadsheetView;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -631,7 +632,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.kishikawakatsumi.SpreadsheetView;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand All @@ -644,7 +644,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.kishikawakatsumi.SpreadsheetViewTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HostApp.app/HostApp";
};
name = Debug;
Expand All @@ -658,7 +657,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.kishikawakatsumi.SpreadsheetViewTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HostApp.app/HostApp";
};
name = Release;
Expand All @@ -673,7 +671,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.kishikawakatsumi.HostApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -687,7 +684,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.kishikawakatsumi.HostApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand Down
Loading

0 comments on commit f4f8636

Please sign in to comment.