Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move tests to CircleCi #40

Merged
merged 22 commits into from
Dec 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
version: 2

jobs:

build-and-test-ios11-iphonex:

macos:
xcode: "9.0"

environment:
DESTINATION: platform=iOS Simulator,OS=11.0,name=iPhone X
SIMULATOR: iPhone X (11.0) [

steps:
- checkout

- run:
name: Start simulator
command: xcrun instruments -w "$SIMULATOR" || true

- run:
name: Fetch CocoaPods Specs
command: curl https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash -s cf

- run:
name: Install CocoaPods
command: pod install --project-directory=Example

- run:
name: Build and run tests
command: ./scripts/build_and_test.sh

- run:
name: Update Codecov
command: bash <(curl -s https://codecov.io/bash)


build-and-test-ios10-iphone7plus:

macos:
xcode: "9.0"

environment:
DESTINATION: platform=iOS Simulator,OS=10.3.1,name=iPhone 7 Plus
SIMULATOR: iPhone 7 Plus (10.3.1) [

steps:
- checkout

- run:
name: Start simulator
command: xcrun instruments -w "$SIMULATOR" || true

- run:
name: Fetch CocoaPods Specs
command: curl https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash -s cf

- run:
name: Install CocoaPods
command: pod install --project-directory=Example

- run:
name: Build and run tests
command: ./scripts/build_and_test.sh

- run:
name: Update Codecov
command: bash <(curl -s https://codecov.io/bash)


lint-podspec:

macos:
xcode: "9.0"

steps:
- checkout

- run:
name: Lint Podspec
command: pod lib lint



workflows:
version: 2

build-and-test:
jobs:
- lint-podspec
- build-and-test-ios11-iphonex
- build-and-test-ios10-iphone7plus
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Example/JJFloatingActionButton.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
1952693F1FD7E4CD0053C785 /* JJCircleViewSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JJCircleViewSpec.swift; sourceTree = "<group>"; };
195269421FD7E6200053C785 /* UIColorExtensionsSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIColorExtensionsSpec.swift; sourceTree = "<group>"; };
195269441FD7E63B0053C785 /* JJActionItemSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JJActionItemSpec.swift; sourceTree = "<group>"; };
195637221FDA9EFB0003B8FF /* config.yml */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = text; lineEnding = 0; name = config.yml; path = ../../.circleci/config.yml; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
198B65FD1FBAE904009A17F2 /* JJFloatingActionButton_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JJFloatingActionButton_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
198B66001FBAE904009A17F2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
198B66021FBAE904009A17F2 /* FirstViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirstViewController.swift; sourceTree = "<group>"; };
Expand All @@ -60,7 +61,6 @@
198B66271FBAEDD7009A17F2 /* JJFloatingActionButton.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; fileEncoding = 4; indentWidth = 2; lineEnding = 0; name = JJFloatingActionButton.podspec; path = ../JJFloatingActionButton.podspec; sourceTree = SOURCE_ROOT; tabWidth = 2; };
198B662D1FBAEE16009A17F2 /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = text; lineEnding = 0; name = .gitignore; path = ../.gitignore; sourceTree = SOURCE_ROOT; tabWidth = 2; };
198B662E1FBAEE16009A17F2 /* .swift-version */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = text; lineEnding = 0; name = ".swift-version"; path = "../.swift-version"; sourceTree = SOURCE_ROOT; tabWidth = 2; };
198B662F1FBAEE16009A17F2 /* .travis.yml */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = text; lineEnding = 0; name = .travis.yml; path = ../.travis.yml; sourceTree = SOURCE_ROOT; tabWidth = 2; };
198EA7E31FD73F6D00F7DA3E /* JJCircleView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = JJCircleView.xib; sourceTree = "<group>"; };
199592A81FD739FA0058BEFC /* BundleExtensionsSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BundleExtensionsSpec.swift; sourceTree = "<group>"; };
199592AB1FD73F070058BEFC /* JJFloatingActionButton.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = JJFloatingActionButton.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -152,12 +152,12 @@
198B662D1FBAEE16009A17F2 /* .gitignore */,
198B662E1FBAEE16009A17F2 /* .swift-version */,
19E247EA1FD93525009A7BA1 /* .swiftlint.yml */,
198B662F1FBAEE16009A17F2 /* .travis.yml */,
19037F0D1FC2ED7B00138594 /* CHANGELOG.md */,
198B66261FBAEDD6009A17F2 /* Gemfile */,
198B66271FBAEDD7009A17F2 /* JJFloatingActionButton.podspec */,
198B66231FBAEDD6009A17F2 /* LICENSE */,
198B66241FBAEDD6009A17F2 /* README.md */,
195637221FDA9EFB0003B8FF /* config.yml */,
);
name = Metadata;
path = JJFloatingActionButton;
Expand Down
19 changes: 19 additions & 0 deletions scripts/build_and_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

set -e

xcodebuild -version

xcodebuild -showsdks

instruments -s devices

xcodebuild clean build test \
-workspace Example/JJFloatingActionButton.xcworkspace \
-scheme JJFloatingActionButton_Example \
-sdk iphonesimulator \
-destination "$DESTINATION" \
-enableCodeCoverage YES \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGN_IDENTITY= \
PROVISIONING_PROFILE=