Browse Source

CI: Add xclogparser to macOS builds to generate issue report

PatTheMav 2 years ago
parent
commit
c19d9c1365
2 changed files with 15 additions and 1 deletions
  1. 1 0
      .github/scripts/.Brewfile
  2. 14 1
      .github/scripts/.build.zsh

+ 1 - 0
.github/scripts/.Brewfile

@@ -3,3 +3,4 @@ brew "cmake"
 brew "git"
 brew "jq"
 brew "xcbeautify"
+brew "xclogparser"

+ 14 - 1
.github/scripts/.build.zsh

@@ -145,11 +145,12 @@ build() {
       local -a build_args=(
         ONLY_ACTIVE_ARCH=NO
         -project obs-studio.xcodeproj
-        -target obs-studio
+        -scheme obs-studio
         -destination "generic/platform=macOS,name=Any Mac"
         -configuration ${config}
         -parallelizeTargets
         -hideShellScriptEnvironment
+        -resultBundlePath ${project_root}/build_macos/build.xcresult
         build
       )
 
@@ -178,6 +179,18 @@ build() {
       } else {
         run_xcodebuild ${build_args}
 
+        local -a jq_query=(
+          'keys[] as $k'
+          '{level: "\($k)"|sub("warnings";"warning")|sub("errors";"failure"), data: (.[$k][])}'
+          '{file: .data.documentURL, start_line: .data.startingLineNumber, end_line: .data.endingLineNumber, start_column: .data.startingColumnNumber, end_column: .data.endingColumnNumber, title: "Compiler \(.level)", message: .data.title, annotation_level: .level}'
+        )
+
+        xclogparser parse --project obs-studio --reporter issues \
+          | jq ${(j: | :)jq_query} \
+          | jq -s '. | unique' \
+          | sed -E -e "s#file://${project_root}/##g" \
+          > ${project_root}/build_issues.json
+
         rm -rf OBS.app
         mkdir OBS.app
         ditto UI/${config}/OBS.app OBS.app