Skip to content

Commit 1abb640

Browse files
authored
[PM-32758] ci: Improve CI cache to fix GitHub runners running out of memory (#6583)
1 parent 64a79ff commit 1abb640

File tree

7 files changed

+20
-297
lines changed

7 files changed

+20
-297
lines changed

.github/actions/setup-android-build/action.yml

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,8 @@ inputs:
88
runs:
99
using: 'composite'
1010
steps:
11-
- name: Validate Gradle wrapper
12-
uses: gradle/actions/wrapper-validation@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
13-
14-
- name: Cache Gradle files
15-
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
16-
with:
17-
path: |
18-
~/.gradle/caches
19-
~/.gradle/wrapper
20-
key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/libs.versions.toml') }}
21-
restore-keys: |
22-
${{ runner.os }}-gradle-v2-
23-
24-
- name: Cache build output
25-
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
26-
with:
27-
path: |
28-
${{ github.workspace }}/build-cache
29-
key: ${{ runner.os }}-build-cache-${{ github.sha }}
30-
restore-keys: |
31-
${{ runner.os }}-build-
11+
- name: Setup Gradle
12+
uses: gradle/actions/setup-gradle@f29f5a9d7b09a7c6b29859002d29d24e1674c884 # v5.0.1
3213

3314
- name: Configure Ruby
3415
uses: ruby/setup-ruby@44511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0

.github/workflows/build-authenticator.yml

Lines changed: 5 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ on:
3131

3232
env:
3333
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
JAVA_VERSION: 21
3534
DISTRIBUTE_TO_FIREBASE: ${{ inputs.distribute-to-firebase || github.event_name == 'push' }}
3635
PUBLISH_TO_PLAY_STORE: ${{ inputs.publish-to-play-store || github.event_name == 'push' }}
3736

@@ -65,43 +64,8 @@ jobs:
6564
with:
6665
persist-credentials: false
6766

68-
- name: Validate Gradle wrapper
69-
uses: gradle/actions/wrapper-validation@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
70-
71-
- name: Cache Gradle files
72-
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
73-
with:
74-
path: |
75-
~/.gradle/caches
76-
~/.gradle/wrapper
77-
key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/libs.versions.toml') }}
78-
restore-keys: |
79-
${{ runner.os }}-gradle-v2-
80-
81-
- name: Cache build output
82-
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
83-
with:
84-
path: |
85-
${{ github.workspace }}/build-cache
86-
key: ${{ runner.os }}-build-cache-${{ github.sha }}
87-
restore-keys: |
88-
${{ runner.os }}-build-
89-
90-
- name: Configure JDK
91-
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
92-
with:
93-
distribution: "temurin"
94-
java-version: ${{ env.JAVA_VERSION }}
95-
96-
- name: Configure Ruby
97-
uses: ruby/setup-ruby@44511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0
98-
with:
99-
bundler-cache: true
100-
101-
- name: Install Fastlane
102-
run: |
103-
bundle config path vendor/bundle
104-
bundle install --jobs 4 --retry 3
67+
- name: Setup Android Build
68+
uses: ./.github/actions/setup-android-build
10569

10670
- name: Check Authenticator
10771
run: bundle exec fastlane check
@@ -128,16 +92,6 @@ jobs:
12892
with:
12993
persist-credentials: false
13094

131-
- name: Configure Ruby
132-
uses: ruby/setup-ruby@44511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0
133-
with:
134-
bundler-cache: true
135-
136-
- name: Install Fastlane
137-
run: |
138-
bundle config path vendor/bundle
139-
bundle install --jobs 4 --retry 3
140-
14195
- name: Log in to Azure
14296
uses: bitwarden/gh-actions/azure-login@main
14397
with:
@@ -197,40 +151,15 @@ jobs:
197151
- name: AZ Logout
198152
uses: bitwarden/gh-actions/azure-logout@main
199153

154+
- name: Setup Android Build
155+
uses: ./.github/actions/setup-android-build
156+
200157
- name: Verify Play Store credentials
201158
if: ${{ env.PUBLISH_TO_PLAY_STORE }}
202159
run: |
203160
bundle exec fastlane run validate_play_store_json_key \
204161
json_key:"${{ github.workspace }}/secrets/authenticator_play_store-creds.json"
205162
206-
- name: Validate Gradle wrapper
207-
uses: gradle/actions/wrapper-validation@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
208-
209-
- name: Cache Gradle files
210-
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
211-
with:
212-
path: |
213-
~/.gradle/caches
214-
~/.gradle/wrapper
215-
key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/libs.versions.toml') }}
216-
restore-keys: |
217-
${{ runner.os }}-gradle-v2-
218-
219-
- name: Cache build output
220-
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
221-
with:
222-
path: |
223-
${{ github.workspace }}/build-cache
224-
key: ${{ runner.os }}-build-cache-${{ github.sha }}
225-
restore-keys: |
226-
${{ runner.os }}-build-
227-
228-
- name: Configure JDK
229-
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
230-
with:
231-
distribution: "temurin"
232-
java-version: ${{ env.JAVA_VERSION }}
233-
234163
- name: Update app CI Build info
235164
run: |
236165
./scripts/update_app_ci_build_info.sh \

.github/workflows/build-testharness.yml

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ on:
2020

2121
env:
2222
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23-
JAVA_VERSION: 21
2423

2524
permissions:
2625
contents: read
@@ -53,44 +52,8 @@ jobs:
5352
with:
5453
persist-credentials: false
5554

56-
- name: Validate Gradle wrapper
57-
uses: gradle/actions/wrapper-validation@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
58-
59-
- name: Cache Gradle files
60-
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
61-
with:
62-
path: |
63-
~/.gradle/caches
64-
~/.gradle/wrapper
65-
key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/libs.versions.toml') }}
66-
restore-keys: |
67-
${{ runner.os }}-gradle-v2-
68-
69-
- name: Cache build output
70-
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
71-
with:
72-
path: |
73-
${{ github.workspace }}/build-cache
74-
key: ${{ runner.os }}-build-cache-${{ github.sha }}
75-
restore-keys: |
76-
${{ runner.os }}-build-
77-
78-
- name: Configure JDK
79-
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
80-
with:
81-
distribution: "temurin"
82-
java-version: ${{ env.JAVA_VERSION }}
83-
84-
- name: Configure Ruby
85-
uses: ruby/setup-ruby@44511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0
86-
with:
87-
bundler-cache: true
88-
89-
- name: Install Fastlane
90-
run: |
91-
gem install bundler:2.2.27
92-
bundle config path vendor/bundle
93-
bundle install --jobs 4 --retry 3
55+
- name: Setup Android Build
56+
uses: ./.github/actions/setup-android-build
9457

9558
- name: Increment version
9659
env:

.github/workflows/build.yml

Lines changed: 6 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ on:
3131

3232
env:
3333
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
JAVA_VERSION: 21
3534
GITHUB_ACTION_RUN_URL: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
3635
DISTRIBUTE_TO_FIREBASE: ${{ inputs.distribute-to-firebase || github.event_name == 'push' }}
3736
PUBLISH_TO_PLAY_STORE: ${{ inputs.publish-to-play-store || github.event_name == 'push' }}
@@ -67,43 +66,8 @@ jobs:
6766
with:
6867
persist-credentials: false
6968

70-
- name: Validate Gradle wrapper
71-
uses: gradle/actions/wrapper-validation@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
72-
73-
- name: Cache Gradle files
74-
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
75-
with:
76-
path: |
77-
~/.gradle/caches
78-
~/.gradle/wrapper
79-
key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/libs.versions.toml') }}
80-
restore-keys: |
81-
${{ runner.os }}-gradle-v2-
82-
83-
- name: Cache build output
84-
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
85-
with:
86-
path: |
87-
${{ github.workspace }}/build-cache
88-
key: ${{ runner.os }}-build-cache-${{ github.sha }}
89-
restore-keys: |
90-
${{ runner.os }}-build-
91-
92-
- name: Configure JDK
93-
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
94-
with:
95-
distribution: "temurin"
96-
java-version: ${{ env.JAVA_VERSION }}
97-
98-
- name: Configure Ruby
99-
uses: ruby/setup-ruby@44511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0
100-
with:
101-
bundler-cache: true
102-
103-
- name: Install Fastlane
104-
run: |
105-
bundle config path vendor/bundle
106-
bundle install --jobs 4 --retry 3
69+
- name: Setup Android Build
70+
uses: ./.github/actions/setup-android-build
10771

10872
- name: Check
10973
run: bundle exec fastlane check
@@ -137,16 +101,6 @@ jobs:
137101
with:
138102
persist-credentials: false
139103

140-
- name: Configure Ruby
141-
uses: ruby/setup-ruby@44511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0
142-
with:
143-
bundler-cache: true
144-
145-
- name: Install Fastlane
146-
run: |
147-
bundle config path vendor/bundle
148-
bundle install --jobs 4 --retry 3
149-
150104
- name: Log in to Azure
151105
uses: bitwarden/gh-actions/azure-login@main
152106
with:
@@ -199,33 +153,8 @@ jobs:
199153
- name: Log out from Azure
200154
uses: bitwarden/gh-actions/azure-logout@main
201155

202-
- name: Validate Gradle wrapper
203-
uses: gradle/actions/wrapper-validation@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
204-
205-
- name: Cache Gradle files
206-
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
207-
with:
208-
path: |
209-
~/.gradle/caches
210-
~/.gradle/wrapper
211-
key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/libs.versions.toml') }}
212-
restore-keys: |
213-
${{ runner.os }}-gradle-v2-
214-
215-
- name: Cache build output
216-
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
217-
with:
218-
path: |
219-
${{ github.workspace }}/build-cache
220-
key: ${{ runner.os }}-build-cache-${{ github.sha }}
221-
restore-keys: |
222-
${{ runner.os }}-build-
223-
224-
- name: Configure JDK
225-
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
226-
with:
227-
distribution: "temurin"
228-
java-version: ${{ env.JAVA_VERSION }}
156+
- name: Setup Android Build
157+
uses: ./.github/actions/setup-android-build
229158

230159
- name: Update app CI Build info
231160
run: |
@@ -455,16 +384,6 @@ jobs:
455384
with:
456385
persist-credentials: false
457386

458-
- name: Configure Ruby
459-
uses: ruby/setup-ruby@44511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0
460-
with:
461-
bundler-cache: true
462-
463-
- name: Install Fastlane
464-
run: |
465-
bundle config path vendor/bundle
466-
bundle install --jobs 4 --retry 3
467-
468387
- name: Log in to Azure
469388
uses: bitwarden/gh-actions/azure-login@main
470389
with:
@@ -503,33 +422,8 @@ jobs:
503422
- name: Log out from Azure
504423
uses: bitwarden/gh-actions/azure-logout@main
505424

506-
- name: Validate Gradle wrapper
507-
uses: gradle/actions/wrapper-validation@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
508-
509-
- name: Cache Gradle files
510-
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
511-
with:
512-
path: |
513-
~/.gradle/caches
514-
~/.gradle/wrapper
515-
key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/libs.versions.toml') }}
516-
restore-keys: |
517-
${{ runner.os }}-gradle-v2-
518-
519-
- name: Cache build output
520-
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
521-
with:
522-
path: |
523-
${{ github.workspace }}/build-cache
524-
key: ${{ runner.os }}-build-cache-${{ github.sha }}
525-
restore-keys: |
526-
${{ runner.os }}-build-
527-
528-
- name: Configure JDK
529-
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
530-
with:
531-
distribution: "temurin"
532-
java-version: ${{ env.JAVA_VERSION }}
425+
- name: Setup Android Build
426+
uses: ./.github/actions/setup-android-build
533427

534428
- name: Update app CI Build info
535429
run: |

0 commit comments

Comments
 (0)