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..1c658751e5c9 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -42,6 +42,15 @@ steps: command: ".buildkite/commands/build-for-testing.sh" env: *common_env plugins: *common_plugins + artifact_paths: + - "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" + # + # 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"