Skip to content

Commit 6adda24

Browse files
authored
Configure Android memory (#248)
* Configure Android memory * Configure max heap for forked JVMs during tests * Add comment to gradle.properties to make it explicit * Revert to Xmx2048m
1 parent 9433e63 commit 6adda24

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ jobs:
6868
- name: Setup
6969
uses: ./.github/actions/setup
7070

71-
- run: yarn test --coverage --testPathPatterns="modules/@shopify/checkout-sheet-kit/tests" --coverageReporters=json-summary
71+
- run:
72+
yarn test --coverage
73+
--testPathPatterns="modules/@shopify/checkout-sheet-kit/tests"
74+
--coverageReporters=json-summary
7275

7376
- name: Coverage comment
7477
if: github.event_name == 'pull_request'
@@ -98,7 +101,7 @@ jobs:
98101

99102
- name: Run Android tests
100103
env:
101-
GRADLE_OPTS: -Xmx6g
104+
GRADLE_OPTS: -Xmx2g -XX:MaxMetaspaceSize=512m
102105
run: |
103106
echo "STOREFRONT_DOMAIN=\"myshopify.com\"" > sample/.env
104107
yarn module build

sample/android/build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,11 @@ def loadProperties() {
2929
}
3030

3131
apply plugin: "com.facebook.react.rootproject"
32+
33+
// Configure memory for forked test JVMs to avoid OOMs in CI
34+
subprojects {
35+
tasks.withType(Test).configureEach {
36+
maxHeapSize = "1536m"
37+
jvmArgs "-XX:MaxMetaspaceSize=512m"
38+
}
39+
}

sample/android/gradle.properties

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
# For more details on how to configure your build environment visit
88
# http://www.gradle.org/docs/current/userguide/build_environment.html
99

10-
# Specifies the JVM arguments used for the daemon process.
11-
# The setting is particularly useful for tweaking memory settings.
10+
# IMPORTANT: This config applies ONLY to the Gradle daemon (local development).
11+
# CI runs tests with `--no-daemon`, so this setting is IGNORED in CI.
12+
# CI memory is configured in `.github/workflows/ci.yml` (GRADLE_OPTS) and
13+
# forked test JVM memory is configured in `sample/android/build.gradle` (Test tasks).
1214
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
1315

1416

0 commit comments

Comments
 (0)