Skip to content

Commit 5d7bbf2

Browse files
authored
Make CI upload xcactivitylog and improve metrics script flexibility (#1725)
2 parents 36d1cb4 + d21a95f commit 5d7bbf2

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.buildkite/commands/build-and-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fi
2121
echo "--- 📦 Zipping test results"
2222
cd build/results/ && zip -rq Simplenote.xcresult.zip Simplenote.xcresult && cd -
2323

24-
.buildkite/commands/track-apple-metrics.sh
24+
.buildkite/commands/track-apple-metrics.sh "build/results/Simplenote.xcresult" "./DerivedData"
2525

2626
echo "--- :arrow_up::ruby: Upload build metrics to Apps Metrics"
2727
ruby .buildkite/commands/upload_metrics.rb

.buildkite/commands/track-apple-metrics.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,22 @@
22

33
set -euo pipefail
44

5+
XCRESULT_PATH="${1:?Error: xcresult path required as first argument}"
6+
DERIVED_DATA_PATH="${2:?Error: DerivedData path required as second argument}"
7+
58
echo "--- :xcode: Store raw xcresulttool JSONs"
69

710
mkdir -p build/xcresulttool
811

912
xcrun xcresulttool get build-results \
10-
--path build/results/Simplenote.xcresult \
13+
--path "$XCRESULT_PATH" \
1114
--format json > build/xcresulttool/xcresulttool-build-results.json
15+
buildkite-agent artifact upload "build/xcresulttool/xcresulttool-build-results.json"
1216

1317
xcrun xcresulttool get test-results tests \
14-
--path build/results/Simplenote.xcresult \
18+
--path "$XCRESULT_PATH" \
1519
--format json > build/xcresulttool/xcresulttool-tests-results.json
20+
buildkite-agent artifact upload "build/xcresulttool/xcresulttool-tests-results.json"
1621

1722
echo "+++ :json: Extract build info from xcresulttool"
1823
jq '{
@@ -36,17 +41,19 @@ mkdir -p build/xclogparser-reports
3641
echo "~~~ Dump xcactivitylog to JSON"
3742
xclogparser dump \
3843
--xcodeproj Simplenote.xcodeproj \
39-
--derived_data ./DerivedData \
44+
--derived_data "$DERIVED_DATA_PATH" \
4045
--output build/xclogparser-reports/xcactivitylog-raw.json
46+
buildkite-agent artifact upload "build/xclogparser-reports/xcactivitylog-raw.json"
4147
echo "~~~ Generate HTML report"
4248
xclogparser parse \
4349
--xcodeproj Simplenote.xcodeproj \
44-
--derived_data ./DerivedData \
50+
--derived_data "$DERIVED_DATA_PATH" \
4551
--reporter html \
4652
--rootOutput build/xclogparser-reports
4753
echo "~~~ Generate JSON report"
4854
xclogparser parse \
4955
--xcodeproj Simplenote.xcodeproj \
50-
--derived_data ./DerivedData \
56+
--derived_data "$DERIVED_DATA_PATH" \
5157
--reporter json > build/xclogparser-reports/report.json
58+
buildkite-agent artifact upload "build/xclogparser-reports/report.json"
5259

.buildkite/pipeline.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,4 @@ steps:
1919
artifact_paths:
2020
- "build/results/*"
2121
- DerivedData/**/*.xcactivitylog
22-
- build/xcresulttool/*.json
2322
- build/xclogparser-reports/index.html
24-
- build/xclogparser-reports/*.json

0 commit comments

Comments
 (0)