{"id":13995442,"url":"https://github.com/Subito-it/CachiKit","last_synced_at":"2025-07-22T21:32:58.586Z","repository":{"id":73390331,"uuid":"220983981","full_name":"Subito-it/CachiKit","owner":"Subito-it","description":"A swift library to parse Xcode's .xcresult files","archived":false,"fork":false,"pushed_at":"2024-08-14T09:50:32.000Z","size":59,"stargazers_count":15,"open_issues_count":0,"forks_count":2,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-08-14T10:26:06.730Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Subito-it.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-11-11T13:09:53.000Z","updated_at":"2024-08-14T09:50:32.000Z","dependencies_parsed_at":"2024-01-20T17:59:49.371Z","dependency_job_id":"95993f8d-62f3-4796-9f35-7134343b9e9c","html_url":"https://github.com/Subito-it/CachiKit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Subito-it%2FCachiKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Subito-it%2FCachiKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Subito-it%2FCachiKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Subito-it%2FCachiKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Subito-it","download_url":"https://codeload.github.com/Subito-it/CachiKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227177974,"owners_count":17743213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-09T14:03:24.789Z","updated_at":"2024-11-29T17:31:47.279Z","avatar_url":"https://github.com/Subito-it.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# 🌵 CachiKit\n\nCachiKit is a swift library to parse Xcode's 11 .xcresult files. It's the core librart used by [Cachi](http://github.com/Subito-it/Cachi) a tool that parses and visualizes tests results in a web interface.\n\n\n# Installation\n\n\n## Swift Package Manager\n\nAdd CachiKit as a dependency to your project:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/Subito-it/CachiKit\", .branch(\"master\"))\n]\n```\n\n# Usage\n\nThe library API is very simple and exposes a set of methods to extract parts of the result structure.\n\n## Get actions invocation record\n\nTo get the root element of the xcresult \n\n```swift\nimport CachiKit\n\nlet url = URL(fileURLWithPath: \"path to the .xcresult\")\nlet cachi = CachiKit(url: url)        \nlet invocationRecord = try? cachi.actionsInvocationRecord()\n```\n\n## Get actions invocation metadata\n\nFrom the action invocation record you can get the id to get the actions invocation metadata\n\n```swift\nimport CachiKit\n\nlet url = URL(fileURLWithPath: \"path to the .xcresult\")\nlet cachi = CachiKit(url: url)        \nlet invocationRecord = try? cachi.actionsInvocationRecord()\nguard let metadataIdentifier = invocationRecord.metadataRef?.id else {\n    return\n}\n\nlet metaData = try? cachi.actionsInvocationMetadata(identifier: metadataIdentifier)\n```\n\n## Get actions test plan run summaries\n\n```swift\nimport CachiKit\n\nlet url = URL(fileURLWithPath: \"path to the .xcresult\")\nlet cachi = CachiKit(url: url)        \nlet invocationRecord = try? cachi.actionsInvocationRecord()\n\nfor action in invocationRecord.actions {\n    guard let testRef = action.actionResult.testsRef else { continue }\n\n    let testPlanSummaries = (try? cachi.actionTestPlanRunSummaries(identifier: testRef.id))?.summaries\n}\n```\n\n## Get action test summary\n\nYou will need the test summary identifier which can be extracted from the TestPlanRunSummaries `testableSummaries`.\n\n```swift\nimport CachiKit\n\nlet url = URL(fileURLWithPath: \"path to the .xcresult\")\nlet cachi = CachiKit(url: url)        \n\nlet testSummaryIdentifier = ... \n\nlet testSummary = try? cachi.actionTestSummary(identifier: testSummaryIdentifier)\n```\n\n## Exporting attachments\n\nYou can export attachments to filesystem\n\n```swift\nimport CachiKit\n\nlet url = URL(fileURLWithPath: \"path to the .xcresult\")\nlet cachi = CachiKit(url: url)        \n\nlet attachmentIdentifier = ... \nlet attachmentDestinationPath = ...\n\ntry? cachi.export(identifier: attachmentIdentifier, destinationPath: attachmentDestinationPath)\n```\n\n# Contributions\n\nContributions are welcome! If you have a bug to report, feel free to help out by opening a new issue or sending a pull request.\n\n\n## Authors\n\n[Tomas Camin](https://github.com/tcamin) ([@tomascamin](https://twitter.com/tomascamin))\n\n\n## License\n\nCachiKit is available under the Apache License, Version 2.0. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSubito-it%2FCachiKit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSubito-it%2FCachiKit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSubito-it%2FCachiKit/lists"}