This is the sample continuous integrated project for iOS (Swift).
- Test
- XCTest: (Only execute sample test code.)
- Lint
- SwiftLint: Enforce Swift style and conventions.
- Manage dependencies
- Carthage: Main dependencies manager.
- Cocoapods: If the library is not supported by Carthage, use Cocoapods.
- Build
- fastlane: Build and Deploy.
- Manual signing: Using
.p12
file /.mobileprovision
file. (Don't use match)
- CircleCI: Lint, Test, and Build in CircleCI.
- PR Comment by Danger: Danger configuration is included. Lint error comes as PR comment.
- Share schemes.
- Install some app to your mac.
- SwiftLint by
brew install swiftlint
. - Carthage by
brew install carthage
.
- SwiftLint by
- Copy or refer to below files. diff
.circleci/config.yml
.gitignore
.swiftlint.yml
Cartfile
Dangerfile
Gemfile
Podfile
certificates
: put.p12
and.mobileprovision
as your certificates. (If you can usematch
, please usematch
.)fastlane
:Fastfile
has your build process. If you want to split config, please create you needed.
- Set environment variable to CircleCI.
DANGER_GITHUB_API_TOKEN
: token for check botIOS_CERTIFICATES_KEY_PASSWORD
: password for p12 file
- Put library into
Cartfile
. - Run
carthage update --platform iOS --no-use-binaries --cache-builds
. - Put
.framework
to your Xcode project. - Push
Carthage/Build
,Cartfile.resolved
.
(If you don't apply --no-use-binaries
, some library create Mac
, tvOS
, watchOS
directory in Carthage/Build
.
We don't want to include that to repository.)
If you can use match in your team, please use match
.
If you cannot use match
, we need to use .p12
file and .mobileprovision
file.
In this sample, store certificates to repository.
And change build setting like below,
If you had error when building, please refer to fastlane's doc.
I want to reduce build time in CircleCI.
- https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md
- https://qiita.com/mono0926/items/636819c42e96a8c4e12d (Japanese)
I want to reduce build time in CircleCI.
But if you use too many/large libraries, you may ignore Carthage/Build
from repository.
In this project, I disable bitcode.
Because we usually create only iOS app. And some library not support bitcode.
This repository is targeting for very simple project.
But in real world, we need to work for complex project.
We have some advice for customizing configuration in Wiki. Please refer to it.