Skip to content

Commit c794537

Browse files
committed
Added cache prepare step to build.yaml
1 parent 263c846 commit c794537

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

.github/workflows/build.yaml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,31 @@ on:
1010
type: [opened, reopened, edited, synchronize]
1111

1212
jobs:
13+
prepare:
14+
name: Prepare Maven cache
15+
runs-on: ubuntu-latest
16+
17+
env:
18+
MAVEN_ARGS: --batch-mode -Dstyle.color=always
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Set up JDK
25+
uses: actions/setup-java@v4
26+
with:
27+
java-version: '8'
28+
distribution: 'temurin'
29+
cache: 'maven'
30+
31+
- name: Download dependencies for JDBC
32+
run: mvn $MAVEN_ARGS dependency:resolve-plugins dependency:go-offline
33+
1334
build:
1435
name: Build JDBC Driver
1536
runs-on: ubuntu-latest
37+
needs: prepare
1638

1739
strategy:
1840
matrix:
@@ -75,9 +97,6 @@ jobs:
7597
if: env.NEED_SDK == 'true'
7698
run: rm -rf yc
7799

78-
- name: Download dependencies
79-
run: mvn $MAVEN_ARGS dependency:resolve-plugins dependency:go-offline
80-
81100
- name: Build with Maven
82101
run: mvn $MAVEN_ARGS package
83102

@@ -144,9 +163,6 @@ jobs:
144163
if: env.NEED_SDK == 'true'
145164
run: rm -rf yc
146165

147-
- name: Download dependencies
148-
run: mvn $MAVEN_ARGS dependency:resolve-plugins dependency:go-offline
149-
150166
- name: Build with Maven
151167
run: mvn $MAVEN_ARGS test
152168

0 commit comments

Comments
 (0)