Skip to content

Commit

Permalink
fix(Travis-CI): Split build into multiple jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Oliveri committed Jan 7, 2019
1 parent 00d2342 commit 29cf1e5
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"branch": "origin/jenkins-testing",
"branch": "jenkins-testing",
"verifyConditions": [],
"tagFormat": "${version}",
"prepare": [
Expand Down
97 changes: 60 additions & 37 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,66 @@
matrix:
include:
- os: linux
dist: trusty
sudo: required
- os: osx
osx_image: xcode10.1
# matrix:
# include:
# - os: linux
# dist: trusty
# sudo: required
# - os: osx
# osx_image: xcode10.1
os: osx
branches:
only:
- master
- develop
- jenkins-testing
env:
global:
- IOS_SDK="iphonesimulator"
- IOS_DESTINATION="name=iPhone XS,OS=12.0"
before_install:
- sudo easy_install pip
- nvm install node
- nvm use node
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
install:
- gem install cocoapods
- gem install jazzy
- sudo pip install bumpversion
- npm install -g [email protected]
- npm install -g @semantic-release/exec
- npm install -g @semantic-release/changelog
- npm install -g @semantic-release/git
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated swiftlint || brew upgrade swiftlint ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated carthage || brew upgrade carthage ; fi
before_script:
- openssl aes-256-cbc -K $encrypted_d84ac0b7eb5c_key -iv $encrypted_d84ac0b7eb5c_iv -in Source/SupportingFiles/WatsonCredentials.swift.enc -out Source/SupportingFiles/WatsonCredentials.swift -d
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pod repo update master --silent ; fi # Gets the latest version of RestKit
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then carthage update --platform iOS ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -qq update -y ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://swift.org/builds/swift-4.1-release/ubuntu1404/swift-4.1-RELEASE/swift-4.1-RELEASE-ubuntu14.04.tar.gz -q; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tar xzf swift-4.1-RELEASE-ubuntu14.04.tar.gz ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PATH=swift-4.1-RELEASE-ubuntu14.04/usr/bin:$PATH ; fi
script:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./Scripts/run-tests.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./Scripts/pod-lint.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then swift build ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then swift test ; fi
jobs:
include:
- stage: install
script:
- sudo easy_install pip
- nvm install node
- nvm use node
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
- gem install cocoapods
- gem install jazzy
- sudo pip install bumpversion
- npm install -g [email protected]
- npm install -g @semantic-release/exec
- npm install -g @semantic-release/changelog
- npm install -g @semantic-release/git
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated swiftlint || brew upgrade swiftlint ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated carthage || brew upgrade carthage ; fi
- stage: before_script
script:
- openssl aes-256-cbc -K $encrypted_d84ac0b7eb5c_key -iv $encrypted_d84ac0b7eb5c_iv -in Source/SupportingFiles/WatsonCredentials.swift.enc -out Source/SupportingFiles/WatsonCredentials.swift -d
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pod repo update master --silent ; fi # Gets the latest version of RestKit
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then carthage update --platform iOS ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -qq update -y ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://swift.org/builds/swift-4.1-release/ubuntu1404/swift-4.1-RELEASE/swift-4.1-RELEASE-ubuntu14.04.tar.gz -q; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tar xzf swift-4.1-RELEASE-ubuntu14.04.tar.gz ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PATH=swift-4.1-RELEASE-ubuntu14.04/usr/bin:$PATH ; fi
- stage: script
script:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./Scripts/run-tests.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./Scripts/pod-lint.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then swift build ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then swift test ; fi
- stage: deploy
script:
- provider: script
script: npx semantic-release
skip_cleanup: true
on:
branch: jenkins-testing
condition: $TRAVIS_OS_NAME = osx
- provider: script
script: Scripts/release-to-cocoapods.sh
skip_cleanup: true
on:
branch: jenkins-testing
condition: $TRAVIS_OS_NAME = osx
- provider: script
script: Scripts/publish-documentation.sh
on:
branch: jenkins-testing
condition: $TRAVIS_OS_NAME = osx

0 comments on commit 29cf1e5

Please sign in to comment.