Skip to content

Commit 8fa64b5

Browse files
committed
Add Go mod cache to integration tests and optimize GRADLE_OPTS
- Added Go module cache (~/go/pkg/mod) to all integration test jobs (github, azure, gitlab, bitbucket-server) - Moved GRADLE_OPTS env var from job-level to step-level, only set for packagehandlers tests - This avoids downloading Go dependencies repeatedly in integration tests - GRADLE_OPTS only affects packagehandlers tests which actually use Gradle
1 parent 8c06d3a commit 8fa64b5

1 file changed

Lines changed: 36 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ jobs:
6060
runs-on: ${{ matrix.os }}-latest
6161
env:
6262
JFROG_CLI_LOG_LEVEL: "DEBUG"
63-
GRADLE_OPTS: -Dorg.gradle.daemon=false
6463
strategy:
6564
fail-fast: false
6665
matrix:
@@ -115,7 +114,6 @@ jobs:
115114
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-
116115
${{ runner.os }}-go-
117116
118-
# Package managers are only needed for Package Handlers tests (fix functionality)
119117
- name: Install npm
120118
if: matrix.suite.package == 'packagehandlers'
121119
uses: actions/setup-node@v3
@@ -189,6 +187,7 @@ jobs:
189187
env:
190188
JF_URL: ${{ secrets.PLATFORM_URL }}
191189
JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }}
190+
GRADLE_OPTS: ${{ matrix.suite.package == 'packagehandlers' && '-Dorg.gradle.daemon=false' || '' }}
192191

193192
github-integration:
194193
name: GitHub Integration Tests
@@ -212,6 +211,15 @@ jobs:
212211
with:
213212
go-version: 1.23.x
214213
cache: false
214+
215+
- name: Go Cache Dependencies
216+
uses: actions/cache@v4
217+
with:
218+
path: ~/go/pkg/mod
219+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
220+
restore-keys: |
221+
${{ runner.os }}-go-
222+
215223
- name: Go Cache Build & Tests
216224
uses: actions/cache@v4
217225
with:
@@ -257,6 +265,15 @@ jobs:
257265
with:
258266
go-version: 1.23.x
259267
cache: false
268+
269+
- name: Go Cache Dependencies
270+
uses: actions/cache@v4
271+
with:
272+
path: ~/go/pkg/mod
273+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
274+
restore-keys: |
275+
${{ runner.os }}-go-
276+
260277
- name: Go Cache Build & Tests
261278
uses: actions/cache@v4
262279
with:
@@ -302,6 +319,15 @@ jobs:
302319
with:
303320
go-version: 1.23.x
304321
cache: false
322+
323+
- name: Go Cache Dependencies
324+
uses: actions/cache@v4
325+
with:
326+
path: ~/go/pkg/mod
327+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
328+
restore-keys: |
329+
${{ runner.os }}-go-
330+
305331
- name: Go Cache Build & Tests
306332
uses: actions/cache@v4
307333
with:
@@ -351,6 +377,14 @@ jobs:
351377
chmod +x $bb_script_path
352378
sh $bb_script_path
353379
380+
- name: Go Cache Dependencies
381+
uses: actions/cache@v4
382+
with:
383+
path: ~/go/pkg/mod
384+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
385+
restore-keys: |
386+
${{ runner.os }}-go-
387+
354388
- name: Go Cache Build & Tests
355389
uses: actions/cache@v4
356390
with:

0 commit comments

Comments
 (0)