-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Patrick Kladek
committed
Jun 9, 2017
1 parent
49ff012
commit 04e3a23
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,39 @@ | ||
# Callisto | ||
[![Twitter: @PatrickKladek](https://img.shields.io/badge/twitter-@PatrickKladek-orange.svg?style=flat)](https://twitter.com/PatrickKladek) | ||
[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/IdeasOnCanvas/Callisto/master/LICENSE) | ||
![alt text](https://img.shields.io/badge/Platform-Mac%2010.12+-blue.svg "Target Mac") | ||
|
||
|
||
![Logo](file:///Users/patrick/Desktop/Callisto Workflow Image.png "Logo") | ||
|
||
If you enabled the clang static analyzer in your xcode project you might notice that your build time nearly doubled. One way to deal with this issue, is to run the static analyzer on your server (buildkite) but there is no built in way to post the results to slack. So we build Callisto. We use Callisto with fastlane so we first must pipe the fastlane output to a temp-file. After that we call Callisto to parse the fastlane file and post the results back to slack. | ||
|
||
``` | ||
#!/bin/bash | ||
fastlane ios staticAnalyze 2>&1 | tee /tmp/fastlane_iOS_Output.txt | ||
Callisto -fastlane "/tmp/fastlane_iOS_Output.txt" \ | ||
-slack "<SLACK_WEBHOOK_URL>" \ | ||
-branch "$BUILDKITE_BRANCH" \ | ||
-githubUsername "<GITHUB_USERNAME>" \ | ||
-githubToken "<GITHUB_TOKEN>" \ | ||
-githubOrganisation "<GITHUB_ORGANISATION>" \ | ||
-githubRepository "<GITHUB_REPOSITORY>" \ | ||
-ignore "todo, -Wpragma" | ||
``` | ||
|
||
### Parameter | ||
* -slack: create a slack webhook url and pass as parameter to Callisto | ||
* -branch: when using buildKite you can simply pass the envirmonment variable "$BUILDKITE_BRANCH" | ||
* -githubUsername: Callisto needs access to the github resolve the branch to the associated pull request. | ||
* -githubToken: instead of using your github password create a token from your account and only allow read access to the repository. This way is recomended by GitHub. | ||
* -githubOrganisation: this parameter is used to create the correct url for communicating with guthub. | ||
* -githubRepository: this parameter is used to create the correct url for communicating with guthub. | ||
* -ignore: pass keywords which should be excluded from your slack report. We use "todo & -Wpragma" since we know they are in our code but we don't want to be messaged about it by every push. | ||
|
||
### How does it work | ||
Callisto simply parses the output from fastlane which mostly pipes through the clang messages from the compiler. By filtering this messages and reformatting them Callisto is able to post them to slack. When you enable GitHub checks you can also merge blocking if Callisto finds an analyzer Message so you are forced to fix it before merging your branch. | ||
|
||
|
||
|
||
Parse Clang Static Analyzer messages and pass them to Slack |