Skip to content

Commit 8cb038f

Browse files
committed
Fix
1 parent 87607af commit 8cb038f

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

.github/workflows/dependency-test.yaml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,10 @@ jobs:
4545
# Output the versions as a string that can be used in the matrix
4646
echo "VERSIONS=${json_versions}" >> $GITHUB_OUTPUT
4747
48-
test-dependency-versions:
49-
needs: fetch-dependency-versions
48+
setup-environment:
5049
runs-on: ubuntu-latest
51-
strategy:
52-
matrix:
53-
version: ${{ fromJson(needs.fetch-dependency-versions.outputs.versions) }}
50+
outputs:
51+
cache-key: ${{ steps.cache-build.outputs.cache-hit }}
5452
steps:
5553
- name: "Checkout repository"
5654
uses: actions/checkout@v4
@@ -67,6 +65,31 @@ jobs:
6765
MVN_ARGS="${{ env.MVN_MULTI_THREADED_ARGS }} clean install -DskipTests -DskipFormatting"
6866
mvn $MVN_ARGS
6967
68+
- name: "Cache build"
69+
id: cache-build
70+
uses: actions/cache@v3
71+
with:
72+
path: ~/.m2/repository
73+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
74+
restore-keys: ${{ runner.os }}-maven-
75+
76+
test-dependency-versions:
77+
needs: [ fetch-dependency-versions, setup-environment ]
78+
runs-on: ubuntu-latest
79+
strategy:
80+
fail-fast: false
81+
matrix:
82+
version: ${{ fromJson(needs.fetch-dependency-versions.outputs.versions) }}
83+
steps:
84+
- name: "Checkout repository"
85+
uses: actions/checkout@v4
86+
87+
- name: "Restore build cache"
88+
uses: actions/cache@v3
89+
with:
90+
path: ~/.m2/repository
91+
key: ${{ needs.setup-environment.outputs.cache-key }}
92+
7093
- name: "Run tests with explicit version"
7194
run: |
7295
MVN_ARGS="${{ env.MVN_MULTI_THREADED_ARGS }} clean package spring-boot:run -pl :spring-app -Dcloud-sdk.version=${{ matrix.version }} -Denforcer.skip=true"

0 commit comments

Comments
 (0)