A Danger-Swift plugin that adds build errors, warnings and unit tests results generated from xcodebuild to your Danger report
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Images
Sources/DangerXCodeSummary
Tests
.gitignore
.rocket.yml
.swift-version
.travis.yml
Dangerfile.swift
Gemfile
Gemfile.lock
Package.resolved
Package.swift
README.md

README.md

DangerXCodeSummary

A Danger-Swift plugin that adds build errors, warnings and unit tests results generated from xcodebuild to your Danger report

Inspired by danger-xcode_summary

DangerXCodeSummary

Getting Started

import DangerPlugin // package: https://github.com/f-meloni/danger-swift-xcodesummary

let summary = XCodeSummary(filePath: "result.json")
  • Generate the report file on CI before run Danger-swift
#!/bin/bash

xcodebuild | XCPRETTY_JSON_FILE_OUTPUT=result.json xcpretty -f `xcpretty-json-formatter`
  • (Recommended) Cache ~/.danger-swift folder

Run with SPM

DangerXCodeSummary can be used with SPM (this repo uses it on the Linux CI), but at the moment falining tests inline messages are not generated, if you use SPM. To generate the report run:

swift test | XCPRETTY_JSON_FILE_OUTPUT=result.json xcpretty -f `xcpretty-json-formatter`

Send report to Danger

summary.report()

Warning and Errors count

if summary.errorsCount > maxErrorCount {
  fail("There are more than \(maxErrorCount) errors"
}

if summary.warningsCount > maxWarningsCount {
  fail("There are more than \(maxWarningsCount) warnings"
}