Skip to content

Commit

Permalink
Merge branch 'trunk' into andy/tablet-hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
nbradbury authored Aug 28, 2024
2 parents d1ed133 + 7cc442c commit 621f490
Show file tree
Hide file tree
Showing 361 changed files with 7,476 additions and 6,657 deletions.
20 changes: 11 additions & 9 deletions .buildkite/beta-builds.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
---

# This pipeline is meant to be run via the Buildkite API, and is
# only used for beta builds

# Nodes with values to reuse in the pipeline.
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#3.4.2
agents:
queue: "android"

steps:
#################
Expand All @@ -14,7 +14,7 @@ steps:
- label: "Gradle Wrapper Validation"
command: |
validate_gradle_wrapper
plugins: *common_plugins
plugins: [$CI_TOOLKIT]

# Wait for Gradle Wrapper to be validated before running any other jobs
- wait
Expand All @@ -28,12 +28,14 @@ steps:
- label: "🕵️ Lint WordPress"
key: wplint
command: ".buildkite/commands/lint.sh wordpress"
plugins: [$CI_TOOLKIT]
artifact_paths:
- "**/build/reports/lint-results*.*"

- label: "🕵️ Lint Jetpack"
key: jplint
command: ".buildkite/commands/lint.sh jetpack"
plugins: [$CI_TOOLKIT]
artifact_paths:
- "**/build/reports/lint-results*.*"

Expand All @@ -47,15 +49,15 @@ steps:
key: wpbuild
command: ".buildkite/commands/beta-build.sh wordpress"
depends_on: wplint
plugins: *common_plugins
plugins: [$CI_TOOLKIT]
notify:
- slack: "#build-and-ship"

- label: ":jetpack: :android: Beta Build"
key: jpbuild
command: ".buildkite/commands/beta-build.sh jetpack"
depends_on: jplint
plugins: *common_plugins
plugins: [$CI_TOOLKIT]
notify:
- slack: "#build-and-ship"

Expand All @@ -67,4 +69,4 @@ steps:
- wpbuild
- jpbuild
command: ".buildkite/commands/create-github-release.sh"
plugins: *common_plugins
plugins: [$CI_TOOLKIT]
17 changes: 10 additions & 7 deletions .buildkite/code-freeze.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# Nodes with values to reuse in the pipeline.
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#3.4.2
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
---


steps:
- label: "Code Freeze"
plugins: *common_plugins
plugins: [$CI_TOOLKIT]
command: |
.buildkite/commands/configure-git-for-release-management.sh
echo '--- :robot_face: Use bot for git operations'
source use-bot-for-git
echo '--- :ruby: Setup Ruby Tools'
install_gems
echo '--- :snowflake: Start Code Freeze'
bundle exec fastlane code_freeze skip_confirm:true
agents:
queue: "tumblr-metal"
10 changes: 0 additions & 10 deletions .buildkite/commands/configure-git-for-release-management.sh

This file was deleted.

10 changes: 9 additions & 1 deletion .buildkite/commands/lint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
#!/bin/bash -eu

echo "--- :microscope: Linting"
echo "--- :rubygems: Setting up Gems"
install_gems

echo "--- :clipboard: Copying gradle.properties"
cp gradle.properties-example gradle.properties

echo "--- :globe_with_meridians: Check Locales Declaration Consistency"
bundle exec fastlane check_declared_locales_consistency app:"$1"

echo "--- :microscope: Linting"

if [ "$1" = "wordpress" ]; then
./gradlew lintWordpressVanillaRelease
exit 0
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/commands/run-instrumented-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [[ "$TESTS_EXIT_STATUS" -ne 0 ]]; then
fi

echo "--- 🚦 Report Tests Status"
results_file=$(find "build/instrumented-tests" -type f -name "*.xml" -print -quit)
results_file="build/instrumented-tests/JUnitReport.xml"

if [[ $BUILDKITE_BRANCH == trunk ]] || [[ $BUILDKITE_BRANCH == release/* ]]; then
annotate_test_failures "$results_file" --slack "build-and-ship"
Expand All @@ -28,6 +28,6 @@ else
fi

echo "--- 🧪 Copying test logs for test collector"
mkdir buildkite-test-analytics && cp build/instrumented-tests/*/*/*.xml buildkite-test-analytics
mkdir buildkite-test-analytics && cp -r build/instrumented-tests/matrix_* buildkite-test-analytics

exit $TESTS_EXIT_STATUS
34 changes: 17 additions & 17 deletions .buildkite/commands/run-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ echo "--- 🧪 Testing"
set +e
if [ "$1" == "wordpress" ]; then
test_suite="testWordpressVanillaRelease koverXmlReportWordpressVanillaRelease"
test_log_dir="WordPress/build/test-results/*/*.xml"
test_results_dir="WordPress/build/test-results"
test_log_dir="${test_results_dir}/*/*.xml"
code_coverage_report="WordPress/build/reports/kover/reportWordpressVanillaRelease.xml"
elif [ "$1" == "processors" ]; then
test_suite=":libs:processors:test :libs:processors:koverXmlReport"
test_log_dir="libs/processors/build/test-results/test/*.xml"
test_results_dir="libs/processors/build/test-results"
test_log_dir="${test_results_dir}/test/*.xml"
code_coverage_report="libs/processors/build/reports/kover/report.xml"
elif [ "$1" == "image-editor" ]; then
test_suite=":libs:image-editor:testReleaseUnitTest :libs:image-editor:koverXmlReportRelease"
test_log_dir="libs/image-editor/build/test-results/testReleaseUnitTest/*.xml"
test_results_dir="libs/image-editor/build/test-results"
test_log_dir="${test_results_dir}/testReleaseUnitTest/*.xml"
code_coverage_report="libs/image-editor/build/reports/kover/reportRelease.xml"
else
echo "Invalid Test Suite! Expected 'wordpress', 'processors', or 'image-editor', received '$1' instead"
Expand All @@ -31,23 +34,20 @@ if [[ "$TESTS_EXIT_STATUS" -ne 0 ]]; then
fi

echo "--- 🚦 Report Tests Status"
path_pattern="*/build/test-results/*/*.xml"
results_files=()
while IFS= read -r -d '' file; do
results_files+=("$file")
done < <(find . -path "$path_pattern" -type f -name "*.xml" -print0)

for file in "${results_files[@]}"; do
if [[ $BUILDKITE_BRANCH == trunk ]] || [[ $BUILDKITE_BRANCH == release/* ]]; then
annotate_test_failures "$file" --slack "build-and-ship"
else
annotate_test_failures "$file"
fi
done
results_file="$test_results_dir/merged-test-results.xml"

# Merge JUnit results into a single file (for performance reasons with reporting)
merge_junit_reports -d ${test_log_dir%/*} -o $results_file

if [[ $BUILDKITE_BRANCH == trunk ]] || [[ $BUILDKITE_BRANCH == release/* ]]; then
annotate_test_failures "$results_file" --slack "build-and-ship"
else
annotate_test_failures "$results_file"
fi

echo "--- 🧪 Copying test logs for test collector"
mkdir buildkite-test-analytics
cp $test_log_dir buildkite-test-analytics
cp $results_file buildkite-test-analytics

echo "--- ⚒️ Uploading code coverage"
.buildkite/commands/upload-code-coverage.sh $code_coverage_report
Expand Down
19 changes: 12 additions & 7 deletions .buildkite/complete-code-freeze.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# Nodes with values to reuse in the pipeline.
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#3.4.2
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
---


steps:
- label: "Complete Code Freeze"
plugins: *common_plugins
plugins: [$CI_TOOLKIT]
command: |
.buildkite/commands/configure-git-for-release-management.sh
echo '--- :robot_face: Use bot for git operations'
source use-bot-for-git
echo '--- :git: Checkout Release Branch'
.buildkite/commands/checkout-release-branch.sh
echo '--- :ruby: Setup Ruby Tools'
install_gems
echo '--- :snowflake: Complete Code Freeze'
bundle exec fastlane complete_code_freeze skip_confirm:true
agents:
queue: "tumblr-metal"
19 changes: 12 additions & 7 deletions .buildkite/finalize-release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# Nodes with values to reuse in the pipeline.
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#3.4.2
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
---


steps:
- label: "Finalize release"
plugins: *common_plugins
plugins: [$CI_TOOLKIT]
command: |
.buildkite/commands/configure-git-for-release-management.sh
echo '--- :robot_face: Use bot for git operations'
source use-bot-for-git
echo '--- :git: Checkout Release Branch'
.buildkite/commands/checkout-release-branch.sh
echo '--- :ruby: Setup Ruby Tools'
install_gems
cp gradle.properties-example gradle.properties
echo '--- :shipit: Finalize Release'
bundle exec fastlane finalize_release skip_confirm:true
agents:
queue: "tumblr-metal"
17 changes: 10 additions & 7 deletions .buildkite/new-beta-release.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# Nodes with values to reuse in the pipeline.
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#3.4.2
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
---


steps:
- label: "New Beta Release"
plugins: *common_plugins
plugins: [$CI_TOOLKIT]
command: |
.buildkite/commands/configure-git-for-release-management.sh
echo '--- :robot_face: Use bot for git operations'
source use-bot-for-git
echo '--- :ruby: Setup Ruby Tools'
install_gems
cp gradle.properties-example gradle.properties
echo '--- :shipit: New Beta Release'
bundle exec fastlane new_beta_release skip_confirm:true
agents:
queue: "tumblr-metal"
Loading

0 comments on commit 621f490

Please sign in to comment.