In this article, we will setup TravisCI to add continuous integration support in our project: https://github.com/Fragki/SwiftLint-Example
Open the GitHub page: https://github.com/Fragki/SwiftLint-Example
From the top menu select Marketplace. then select Continuous Integration from the list on the left
Select Travis CI
Scroll down to the pricing sector and select the open source.
Tap install it for free:
Tap complete order and start installation
Tap only select repositories and choose your repository. Then tap install.
Then tap sign in with GitHub, and authorize TravisCI
Now, we have to go to the root folder of our project and create a travis.yml file:
touch .travis.yml
1 |
language: swift<br>os: osx<br>osx_image: xcode10.2<br>xcode_project: BankStatement.xcodeproj<br>xcode_scheme: BankStatement<br>script: xcodebuild clean build test -project BankStatement.xcodeproj -scheme BankStatement ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY="" |
Commit and push the .travis.yml
Now go to Travis console to trigger a build:
And after the build finish, we get the results:
Also, we can include the checks in our PRs. Go to Travis settings and enable the build on pull requests:
And our PRs will do automatically the checks: