jbehrens94
jbehrens94

Reputation: 2396

Travis CI with Swift Framework

I'm not sure if Travis CI is behaving like it should, I feel like it's "overreacting". It's testing when I open a PR, when I merge the PR and when I (for example) edit the README.md and push to master.

This is my Travis CI config YML.

language: objective-c

xcode_workspace: {name}
xcode_scheme: {name}Tests
xcode_sdk: iphonesimulator10.0
osx_image: xcode8.3

branches:
  only:
    - master

before_install:
  - pod repo update

script:
  - xcodebuild -workspace {name}.xcworkspace -scheme {name} -sdk iphonesimulator ONLY_ACTIVE_ARCH=no
  - xcodebuild test -workspace {name}.xcworkspace -scheme {name}Tests -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO -destination 'platform=iOS Simulator,name=iPhone 6s Plus,OS=10.0'

Upvotes: 0

Views: 123

Answers (1)

n3wbie
n3wbie

Reputation: 1126

It is not "overreacting" :p

Actually, from my own kinda newbie experience, it is its default behaviour, which is justified. When you open a PR, it tests whether the branch you want to merge is not breaking anything, which is normal. Once the merge happened, it tests if nothing has been broken by the merge, which is maybe what you call overreacting. But it actually happened to me once, even if i can't give you the reason why, it was quite a long time ago.

The documentation of Travis-CI explains how to limit the jobs to branches, but i guess you already know it when i read your travis.yml. Just in case, it is this part. What you may not be aware of is the possibility to skip a build by specifying

[ci skip] or [skip ci]

in the git commit message. Here is the doc reference. I haven't actually ever heard about a way to prevent Travis to test before and after PR.

Hope this helps.


Edit : When watching your last build on travis-ci.org, on the top right, you have the "More options" button. Click on it and select Setting. Here you can select whether you want to Build branch updates and/or Build pull request updates. Take a look a bit further on this setting page, you can also decide to auto-cancel builds when there i a new one in the queue, e.g. when you just realize you made a mistake in your last push and make a new push to fix it.

Upvotes: 3

Related Questions