From b584af121b0413d86e661322b03f06acd43f8126 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Mon, 23 May 2022 15:34:42 +1000 Subject: [PATCH 1/5] Update CI build step to upload build artifacts to Buildkite --- .buildkite/commands/build-for-testing.sh | 11 +++++++++++ .buildkite/pipeline.yml | 2 ++ 2 files changed, 13 insertions(+) diff --git a/.buildkite/commands/build-for-testing.sh b/.buildkite/commands/build-for-testing.sh index d3ff791b9200..7ee188ef7cf6 100755 --- a/.buildkite/commands/build-for-testing.sh +++ b/.buildkite/commands/build-for-testing.sh @@ -19,8 +19,19 @@ echo "--- Installing Secrets" bundle exec fastlane run configure_apply echo "--- :hammer_and_wrench: Building" +set +e bundle exec fastlane build_for_testing +BUILD_EXIT_STATUS=$? +set -e + +if [[ $BUILD_EXIT_STATUS -ne 0 ]]; then + # Keep the (otherwise collapsed) current section open in Buildkite logs on error. See https://buildkite.com/docs/pipelines/managing-log-output#collapsing-output + echo "^^^ +++" + echo "Build failed!" +fi echo "--- :arrow_up: Upload Build Products" tar -cf build-products.tar DerivedData/Build/Products/ upload_artifact build-products.tar + +exit $BUILD_EXIT_STATUS diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index e606c9d84628..80e365398767 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -42,6 +42,8 @@ steps: command: ".buildkite/commands/build-for-testing.sh" env: *common_env plugins: *common_plugins + artifact_paths: + - "build/results/*" notify: - github_commit_status: context: "Build for Testing" From bba7c437cdccd9e77197ebf1e9ad20fc3c70e25a Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 24 May 2022 11:25:26 +1000 Subject: [PATCH 2/5] Add note regarding empty `build/results/` for build without testing --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 80e365398767..765b7cddd311 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -43,7 +43,7 @@ steps: env: *common_env plugins: *common_plugins artifact_paths: - - "build/results/*" + - "build/results/*" # FIXME: Note that there's nothing in there–because we only build, not run the tests? notify: - github_commit_status: context: "Build for Testing" From d89e2ac60d83bc964b08001ed9b8b8f2103ca93d Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 24 May 2022 11:25:48 +1000 Subject: [PATCH 3/5] Upload `.xcactivitylog` from `DerivedData`... If any? --- .buildkite/pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 765b7cddd311..c96904cb41a6 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -44,6 +44,7 @@ steps: plugins: *common_plugins artifact_paths: - "build/results/*" # FIXME: Note that there's nothing in there–because we only build, not run the tests? + - "DerivedData/Logs/Build/*.xcactivitylog" notify: - github_commit_status: context: "Build for Testing" From 78e48b9d23f347185b496f249e4c63209bcca654 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 24 May 2022 12:03:55 +1000 Subject: [PATCH 4/5] Upload the whole derived data folder --- .buildkite/pipeline.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index c96904cb41a6..6a5d7da1e2aa 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -44,7 +44,9 @@ steps: plugins: *common_plugins artifact_paths: - "build/results/*" # FIXME: Note that there's nothing in there–because we only build, not run the tests? - - "DerivedData/Logs/Build/*.xcactivitylog" + # FIXME: Why isn't there any file in there?! See https://buildkite.com/automattic/wordpress-ios/builds/7828#964dc9dc-b8ec-4562-8d78-64fccffc0fd2 + # - "DerivedData/Logs/Build/*.xcactivitylog" + - DerivedData notify: - github_commit_status: context: "Build for Testing" From 3ae4959db8692035b246f2e08741a405b9792e6c Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 26 May 2022 14:52:32 +1000 Subject: [PATCH 5/5] Try a different path --- .buildkite/pipeline.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 6a5d7da1e2aa..1c658751e5c9 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -46,7 +46,11 @@ steps: - "build/results/*" # FIXME: Note that there's nothing in there–because we only build, not run the tests? # FIXME: Why isn't there any file in there?! See https://buildkite.com/automattic/wordpress-ios/builds/7828#964dc9dc-b8ec-4562-8d78-64fccffc0fd2 # - "DerivedData/Logs/Build/*.xcactivitylog" - - DerivedData + # + # Note to self: You can't upload _folder_ on Buildkite, only files. + # _If_ you anted to upload the whole DerivedData folder, you'd have to zip it first. + # - DerivedData + - DerivedData/WordPress/Logs/Build/*.xcactivitylog notify: - github_commit_status: context: "Build for Testing"