An example iOS Reddit client with emphasis on testing and automation.
Requirements:
CI/CD Server:
- macOS 10.14
- Xcode 10.1 (Swift 4.2)
- Simulator w/ iOS 12.1
- Xcode command line tools
- Jenkins 2.15 with JDK 8+
Idea:
If a macOS machine with public IP is not available, Serveo is used to publicly expose our Jenkins instance so Github can send webhooks to Jenkins, triggering builds on each pull request. If a macOS machine with public is available, we send Github webhooks directly to that machine.
Steps:
- Download and install Jenkins for macOS.
- Run Jenkins with
java -jar jenkins.war
if machine uses JDK 8. - Run Jenkins with
java -jar jenkins.war --enable-future-if
if machine uses java JDK 10. - Configure Github to send webhooks to Jenkins on macOS machine
- Install and configure Jenkins Xcode Integration.
- Attempt Pull Request.
- Wait for Jenkins + GitHub to do its magic.
iOS Technologies Involved
- CoreData
- Alamofire
- Kingfisher
- SwiftyJSON
Recommended Test Environment
iPhone XS Simulator with iOS 12.1+
Please have the Simulator launched and ready before running the Test(XCTest)!
© 2018-2019 William Yang
3