Example .travis.yml for iOS projects based on Cocoapods
I have this very simple iOS project. It uses Cocoapods to manage dependencies and includes AFNetworking as one of its dependencies. Currently my project code is just making a simple HTTP GET request and a test (written using Specta) checks if it succeeds.
Now I am trying to do this with Travis-CI. I already checked the xctool CI and objective-c CI tutorial from Travis-CI , my current .travis-ci.yml is :
language: objective-c
xcode_project: Foobar.xcodeproj
xcode_schema: Foobar
Last output lines from CI console:
"Echo" command Check out our documentation for more information: http://about.travis-ci.org/docs/user/languages/objective-c/ "" exited at 0.
Done. Your build finished at 0.
It seems to me that nothing has been tested. There's definitely something wrong with my .travis.yml. So my questions are:
- There is a .xworkspace file created by Cocoapods, so which one am I using in .travis.yml, .xcodeproj, or .workspace?
- Which scheme to use,
Foobar
orFoobarTests
? - Do I have to additionally specify the command
script: xctool ...
? - From the xctool CI tutorial :
Click the + button and add each dependency to the project. CocoaPods will show up as a static library named Pods.
I cannot add the project Pods
as a whole, but rather every single project. It is right? And does that mean what should I do every time I add a library to a subfile?
source to share
I figured it out with the above @Schemetrical comment and an overview of my .travis.yml. It turns out a typo: there xcode_schema
should be xcode_scheme
...
So, as a result, my .travis.yml :
language: objective-c
xcode_workspace: Foobar.xcworkspace
xcode_scheme: Foobar
For vanilla Cocoapods generated project / workspace, there is no such schema called FoobarTests
, but rather just one named Foobar
. Therefore, this should answer questions 1-3 above.
For question 4, I only added two additional targets, Pods-Foobar
and Pods-FoobarTests
, and they should contain all dependencies from your subfile.
source to share