Skip to content

Commit

Permalink
Improve woodpecker build times (#1139)
Browse files Browse the repository at this point in the history
* Update woodpecker config

* Upgradle gradle to 8.2.1 and set buildtoolsversion

* Trigger woodpecker

* Test using gradle instead of gradlew

* Test run using drone cache

* Fix formatting

* Trigger woodpecker

* Probably wont work

* Probably wont work

* No privileges as estimated

* Test

* Alr should print the size

* Stuck?

* Does weird stuff in logs if debug:true

* try caches only

* try caches only

* try caches only

* Add wrapper

* trigger woodpecker

* Test wrapper only

* trigger woodpecker

* Try something diff

* Try something diff

* Show me the gradle locations

* Show me the .gradle file locations

* Hmmm

* dont sopt plz

* Introspect

* wow

* Where is this .gradle

* Hmmm

* TEST

* Only rebuild when build.gradle changes

* Only rebuild when build.gradle changes

* Shouldnt rebuild

* Shouldnt rebuild

* Go ahead

* Trigger woodpecker

---------

Co-authored-by: Dessalines <[email protected]>
  • Loading branch information
MV-GH and dessalines authored Aug 22, 2023
1 parent 014582c commit 4c89a56
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 9 deletions.
51 changes: 48 additions & 3 deletions .woodpecker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,74 @@ steps:
commands:
- prettier -c "*.md" "*.yml"

restore-cache:
image: meltwater/drone-cache:v1
pull: true
settings:
restore: true
endpoint:
from_secret: MINIO_ENDPOINT
access-key:
from_secret: MINIO_WRITE_USER
secret-key:
from_secret: MINIO_WRITE_PASSWORD
bucket:
from_secret: MINIO_BUCKET
region: us-east-1
cache_key: "jerboa-cache"
path-style: true
mount:
- ".gradle"
secrets:
[MINIO_ENDPOINT, MINIO_WRITE_USER, MINIO_WRITE_PASSWORD, MINIO_BUCKET]

check_formatting:
image: cimg/android:2023.08
commands:
- sudo chown -R circleci:circleci .
- ./gradlew lintKotlin
environment:
GRADLE_RO_DEP_CACHE: .depcache
GRADLE_USER_HOME: ".gradle"

build_project:
image: cimg/android:2023.08
commands:
- sudo chown -R circleci:circleci .
- ./gradlew assembleDebug
environment:
GRADLE_RO_DEP_CACHE: .depcache
GRADLE_USER_HOME: ".gradle"

run_tests:
image: cimg/android:2023.08
commands:
- sudo chown -R circleci:circleci .
- ./gradlew testDebug
environment:
GRADLE_RO_DEP_CACHE: .depcache
GRADLE_USER_HOME: ".gradle"

rebuild-cache:
image: meltwater/drone-cache:v1
pull: true
settings:
rebuild: true
endpoint:
from_secret: MINIO_ENDPOINT
access-key:
from_secret: MINIO_WRITE_USER
secret-key:
from_secret: MINIO_WRITE_PASSWORD
bucket:
from_secret: MINIO_BUCKET
cache_key: "jerboa-cache"
region: us-east-1
path-style: true
mount:
- ".gradle"
secrets:
[MINIO_ENDPOINT, MINIO_WRITE_USER, MINIO_WRITE_PASSWORD, MINIO_BUCKET]
when:
- path:
include: ["app/build.gradle.kts"]

notify:
image: alpine:3
Expand Down
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ plugins {
apply(from = "update_instances.gradle.kts")

android {
buildToolsVersion = "34.0.0-rc3"
compileSdk = 34

defaultConfig {
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ kotlin.code.style=official
android.nonTransitiveRClass=true
android.nonFinalResIds=false
org.gradle.configuration-cache=true
# TODO remove once AGP 8.2 is out of alpha
android.suppressUnsupportedCompileSdk=34
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=38f66cd6eef217b4c35855bb11ea4e9fbc53594ccccb5fb82dfd317ef8c2c5a3
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionSha256Sum=03ec176d388f2aa99defcadc3ac6adf8dd2bce5145a129659537c0874dea5ad1
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 8 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -133,10 +130,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down Expand Up @@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down

0 comments on commit 4c89a56

Please sign in to comment.