Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dependency Cache] Enable Dependency Cache on CI [with GRADLE_RO_DEP_CACHE] #13122

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
c258762
CI: Temporarily remove all pipeline steps expect for the prototype build
ParaskP7 Dec 12, 2024
6a5af1e
CI: Add a scheduled dependency cache job
ParaskP7 Dec 12, 2024
ad88dd7
CI: Add project prefix env to distinguish gradle dependency cache key
ParaskP7 Dec 12, 2024
7767fb4
CI: Test with shared read-only dependency cache
ParaskP7 Dec 12, 2024
5218c4e
CI: Echo on gradle ro dep cache environment variable
ParaskP7 Dec 12, 2024
9685af5
CI: Test without shared read-only dependency cache
ParaskP7 Dec 13, 2024
51ac5fc
CI: Remove project prefix env to distinguish gradle dependency cache key
ParaskP7 Dec 16, 2024
8487e3d
CI: Measure how long it takes to save/restore the cache
ParaskP7 Dec 16, 2024
4ba57b7
CI: Cache all dependencies as part of the scheduled dependency cache job
ParaskP7 Dec 16, 2024
fb26e91
CI: Revert the removal of all pipeline steps
ParaskP7 Dec 16, 2024
7e94cdc
CI: Measure the (un)compressed cache size during save/restore
ParaskP7 Dec 17, 2024
cec496c
CI: Add extra echo to force buildkite ci show the expandable sections
ParaskP7 Dec 17, 2024
93bfc61
CI: Add and improve download/save/restore cache logs
ParaskP7 Dec 17, 2024
e6f3975
Merge branch 'trunk' of github.com:woocommerce/woocommerce-android in…
ParaskP7 Dec 20, 2024
33b1a0c
Merge branch 'trunk' of github.com:woocommerce/woocommerce-android in…
ParaskP7 Dec 20, 2024
f734d5b
Merge branch 'trunk' of github.com:woocommerce/woocommerce-android in…
ParaskP7 Jan 7, 2025
d4632b8
CI: Disable restore cache
ParaskP7 Jan 8, 2025
ff41696
CI: Enable restore cache
ParaskP7 Jan 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .buildkite/commands/cache-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

set -euo pipefail

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

echo "--- :closed_lock_with_key: Installing Secrets"
bundle exec fastlane run configure_apply

echo "--- 🛠 Download Mobile App Dependencies [Assemble Mobile App]"
./gradlew :WooCommerce:assembleJalapenoDebug
echo ""

echo "--- 🛠 Download Wear App Dependencies [Assemble Wear App]"
./gradlew :WooCommerce-Wear:assembleJalapenoDebug
echo ""

echo "--- 🧹 Download Lint Dependencies [Lint Mobile App]"
./gradlew :WooCommerce:lintJalapenoDebug
echo ""

echo "--- 🧹 Download Detekt Dependencies [Run Detekt]"
./gradlew detektAll
echo ""

echo "--- 🧪 Download Unit Test Dependencies [Assemble Unit Tests]"
./gradlew assembleJalapenoDebugUnitTest lib:cardreader:assembleDebugUnitTest lib:iap:assembleDebugUnitTest
echo ""

echo "--- 🧪 Download Android Test Dependencies [Assemble Android Tests]"
./gradlew assembleJalapenoDebugAndroidTest
echo ""

echo "--- 💾 Save Cache"
save_gradle_dependency_cache
1 change: 1 addition & 0 deletions .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@

set -e

echo "--- 💾 Restore Cache"
restore_gradle_dependency_cache || true
12 changes: 12 additions & 0 deletions .buildkite/schedules/dependency-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
---

agents:
queue: "android"

steps:
- label: "dependency cache"
command: |
echo "--- 💾 Download and Cache Dependencies"
.buildkite/commands/cache-dependencies.sh
plugins: [$CI_TOOLKIT]
3 changes: 1 addition & 2 deletions .buildkite/shared-pipeline-vars
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
# This file is `source`'d before calling `buildkite-agent pipeline upload`, and can be used
# to set up some variables that will be interpolated in the `.yml` pipeline before uploading it.

export CI_TOOLKIT="automattic/a8c-ci-toolkit#3.7.1"
export CI_TOOLKIT="automattic/a8c-ci-toolkit#275fb27c9bcd4d0e9d9a77ca2be733755b83759e"
export TEST_COLLECTOR="test-collector#v1.10.1"

2 changes: 1 addition & 1 deletion .configure
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@
}
],
"file_dependencies": []
}
}
Loading