Continuous integration is this guide is based on Gitlab CI. Each step of this setup, except of the first one, is optional - implement only what you need.
- Gitlab CI. To setup Gitlab CI you need to add .gitlab-ci.yml file to the root of project's source. It should look like this:
- analyze
- test
- crashlytics
analyzation:
stage: analyze
script:
- ./analyze.sh
except:
- triggers
testing:
stage: test
script:
- xcodebuild -workspace MyWorkspace.xcworkspace -scheme MyScheme -configuration MyConfiguration -destination "platform=iOS Simulator,name=iPhone 7,OS=10.3" build test | xcpretty
except:
- triggers
crashlytics_build:
stage: crashlytics
script:
- fastlane ios release_dev
only:
- develop
except:
- triggers```
Add only stages you need.
2. **Analyzation Stage**
To setup analyzation you need to do the following:
* Properly configure the project for Release configuration, especially enable almost all warnings:
- Set `Treat Warnings as Errors` to Yes.
- Set `Documentation Comments` to Yes.
- Set `Empty Loop Bodies` to Yes.
- Set `Four Character Literals` to Yes.
- Set `Hidden Local Variables` to Yes.
- Set `Implicit Boolean Conversions` to Yes.
- Set `Implicit Constant Conversions` to Yes.
- Set `Implicit Conversion to 32 Bit type` to Yes.
- Set `Implicit Enum Conversions` to Yes.
- Set `Implicit Integer to Pointer Conversion` to Yes.
- Set `Implicit Signedness Conversions` to Yes.
- Set `Infinite Recursion` to Yes.
- Set `Initializer Not Fully Bracketed` to Yes.
- Set `Mismatched Return Type` to Yes (treat as error).
- Set `Missing Fields in Structure Initializers` to Yes.
- Set `Missing Function Prototypes` to Yes.
- Set `Missing Newline At End of File` to Yes.
- Set `Out-of-Range Enum Assignments` to Yes.
- Set `Sign Comparison` to Yes.
- Set `Suspicious Implicit Conversions` to Yes.
- Set `Uninitialized Variables` to Yes (Aggressive).
- Set `Unknown Pragma` to Yes.
- Set `Unreachable Code` to Yes.
- Set `Unused Functions` to Yes.
- Set `Unused Labels` to Yes.
- Set `Unused Parameters` to Yes.
- Set `Unused Variables` to Yes.
- Set `Suspicious Moves` to Yes.
- Set `Direct Usage of 'isa'` to Yes (treat as error).
- Set `Duplicate Method Definitions` to Yes.
- Set `Implicit Atomic Objective-C Properties` to Yes.
- Set `Overriding Deprecated Objective-C Methods` to Yes.
- Set `Strict Selector Matching` to Yes.
- Set `Undeclared Selector` to Yes.
- Set `Unintentional Root Class` to Yes (treat as error).
- Set `Implicit Ownership Types on our parameters` to Yes.
- Set `Implicit Retain of 'self' within blocks` to Yes.
- Set `Repeatedly using a __weak reference` to Yes.
- Set `Misuse of 'nonnull'` to Yes (Aggressive).
- Set `Missing Localizability` to Yes.
- Set `Floating Point Value used as Loop Counter` to Yes.
- Set `Use of 'rand' functions` to Yes.
- Set `Use of 'strcpy' and 'strcat'` to Yes.