Move xcresultparser to the Tools to avoid long recompilation times through brew

This commit is contained in:
Stefan Ceriu
2026-08-18 13:45:02 +03:00
parent 771d10ac6b
commit cd453bc6fa
4 changed files with 24 additions and 7 deletions
+10 -1
View File
@@ -1,5 +1,5 @@
{
"originHash" : "ec77bc40677bd20f99d813dea09781e534f4cb4539fb504b27d997b95f98d6d0",
"originHash" : "eb16f7bcd7ef32b27433d7e2ee4cd129ad3c29e854c62696900658127333c78e",
"pins" : [
{
"identity" : "pkl-swift",
@@ -64,6 +64,15 @@
"version" : "1.6.5"
}
},
{
"identity" : "xcresultparser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/a7ex/xcresultparser",
"state" : {
"revision" : "95ca65d0bd56250ccd16331f5b0480a1a2c0c5e9",
"version" : "2.2.0"
}
},
{
"identity" : "yams",
"kind" : "remoteSourceControl",
+4 -2
View File
@@ -10,7 +10,8 @@ var dependencies: [Package.Dependency] = [
// .package(path: "../../../swift-command-line-tools"),
.package(url: "https://github.com/swiftlang/swift-subprocess", .upToNextMinor(from: "0.3.0")),
.package(url: "https://github.com/jpsim/Yams", .upToNextMinor(from: "6.2.2")),
.package(url: "https://github.com/apple/swift-log", .upToNextMinor(from: "1.10.1"))
.package(url: "https://github.com/apple/swift-log", .upToNextMinor(from: "1.10.1")),
.package(url: "https://github.com/a7ex/xcresultparser", .upToNextMinor(from: "2.2.0"))
]
if FileManager.default.fileExists(atPath: "Enterprise/Pipeline/Package.swift") {
@@ -33,7 +34,8 @@ let package = Package(
.product(name: "CommandLineTools", package: "swift-command-line-tools"),
.product(name: "Subprocess", package: "swift-subprocess"),
.product(name: "Yams", package: "Yams"),
.product(name: "Logging", package: "swift-log")
.product(name: "Logging", package: "swift-log"),
.product(name: "XcresultparserLib", package: "xcresultparser")
],
path: "Tools/Sources",
swiftSettings: [
+8 -2
View File
@@ -1,6 +1,7 @@
import ArgumentParser
import Foundation
import Subprocess
import XcresultparserLib
import Yams
struct CI: ParsableCommand {
@@ -75,7 +76,11 @@ struct CI: ParsableCommand {
}
do {
try await run(.path("/bin/zsh"), ["-cu", "xcresultparser -q -o cobertura -t \(target) -p \(projectPath) \(resultBundlePath) > \(outputPath)"])
let converter = try CoberturaCoverageConverter(with: URL(filePath: resultBundlePath),
projectRoot: projectPath,
coverageTargets: [target],
strictPathnames: false)
try converter.xmlString(quiet: true).write(toFile: outputPath, atomically: true, encoding: .utf8)
logger.info("\n📊 Coverage report: \(outputPath)\n")
} catch {
logger.error("\n❌ Failed to collect coverage for \(resultBundle): \(error.localizedDescription)\n")
@@ -95,7 +100,8 @@ struct CI: ParsableCommand {
}
do {
try await run(.path("/bin/zsh"), ["-cu", "xcresultparser -q -o junit -p \(projectPath) \(resultBundlePath) > \(outputPath)"])
let junitXML = try JunitXML(with: URL(filePath: resultBundlePath), projectRoot: projectPath)
try junitXML.xmlString.write(toFile: outputPath, atomically: true, encoding: .utf8)
logger.info("📋 Test results: \(outputPath)")
} catch {
logger.error("\n❌ Failed to collect test results for \(resultBundle): \(error.localizedDescription)\n")
+2 -2
View File
@@ -15,7 +15,7 @@ setup_github_actions_environment() {
unset HOMEBREW_NO_INSTALL_FROM_API
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
brew update && brew install xcodegen swiftlint swiftformat git-lfs pkl a7ex/homebrew-formulae/xcresultparser
brew update && brew install xcodegen swiftlint swiftformat git-lfs pkl
}
setup_github_actions_translations_environment() {
@@ -30,7 +30,7 @@ setup_github_actions_translations_environment() {
}
xcode_select_for_github_actions() {
# We need to select it globally for other processes like xcresultparser and our custom tools to use the same Xcode version.
# We need to select it globally for our custom tools to use the same Xcode version.
sudo xcode-select -s /Applications/Xcode_26.5.0.app
}