Skip to content

Commit

Permalink
Check result warnings (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
BB9z committed Jan 20, 2024
1 parent 5c84778 commit eba395e
Show file tree
Hide file tree
Showing 5 changed files with 486 additions and 16 deletions.
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

# Xcode Project
**/*.xcodeproj/xcuserdata/
**/*.xcworkspace/xcuserdata/
**/.swiftpm/xcode/xcuserdata/
**/*.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
**/*.xcworkspace/xcshareddata/*.xccheckout
**/*.xcworkspace/xcshareddata/*.xcscmblueprint
**/*.playground/**/timeline.xctimeline
.idea/

# Build
**/.build/
**/Build/
DerivedData/
*.ipa

# Carthage
Carthage/

# CocoaPods
Pods/

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/sign&cert

# Tests
/.test

# CSV
*.orig
.svn

# Other
*~
.DS_Store
*.swp
*.save
._*
*.bak
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ Environment variables:
* Supports [xcCommand](#xcCommand) variables.
* `CI_CHECK_STYLE_FILE`: Export checkstyle.xml to this path.

### check-result

Environment variables:

* `CI_XCODE_WARNING_IGNORE_TYPES`: Ignore warning types, separated by comma. eg. `"No-usage,Deprecations,Documentation Issue"`
* `CI_XCODE_WARNING_LIMIT`: Limit warning count. eg. `100`

### fetch-mr

Fetch merge request.
Expand Down
19 changes: 5 additions & 14 deletions build-ios
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

set -euo pipefail

. "$(dirname $0)/lib/checkstyle.sh"
. "$(dirname $0)/lib/xccommand.sh"

# Default configuration
Expand All @@ -18,8 +17,8 @@ if [[ ! -v XC_REDIRECT_STDERR ]]; then
XC_REDIRECT_STDERR=1
fi

if [[ ! -v XC_RESULT_BUNDLE ]]; then
XC_RESULT_BUNDLE="build/xc-build.xcresult"
if [[ -z ${XC_RESULT_BUNDLE-} ]]; then
export XC_RESULT_BUNDLE="build/xc-build.xcresult"
logInfo "[Path] Use default result bundle: $XC_RESULT_BUNDLE"
fi
if [[ ! -v XC_LOG_FILE ]]; then
Expand All @@ -30,9 +29,7 @@ elif [[ -n "${CI_CHECK_STYLE_FILE:-}" ]]; then
logInfo "[Path] Use default log file: $XC_LOG_FILE"
fi

if [[ -n $XC_RESULT_BUNDLE ]]; then
prepeareResultFile "$XC_RESULT_BUNDLE"
fi
prepeareResultFile "$XC_RESULT_BUNDLE"

logInfo "[Xcode] Building..."

Expand All @@ -46,15 +43,9 @@ if [[ -n $XC_LOG_FILE ]]; then
}
logInfo "[Xcode] Building completed."
tail -n 4 "$XC_LOG_FILE"

if [[ -n "${CI_CHECK_STYLE_FILE:-}" ]]; then
if $CI_XCBEATIFY_USED; then
checkstyleFromXcbeautify < "$XC_LOG_FILE" > "$CI_CHECK_STYLE_FILE"
else
checkstyleFromXcodebuild < "$XC_LOG_FILE" > "$CI_CHECK_STYLE_FILE"
fi
fi
else
xcCommand build
logInfo "[Xcode] Building completed."
fi

"$(dirname $0)/check-result" listIssues summary checkstyle
Loading

0 comments on commit eba395e

Please sign in to comment.