Skip to content

Commit 5e81281

Browse files
committed
Test actions/cache with 'maven', 'gradle', 'sbt'
1 parent 5e5a440 commit 5e81281

File tree

2 files changed

+35
-35
lines changed

2 files changed

+35
-35
lines changed

.github/workflows/test-actions-cache.yml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: Test cache option
1+
name: Test actions/cache with 'maven', 'gradle', 'sbt'
22

33
on:
4-
push:
5-
branches:
6-
- sapMachine
4+
# push:
5+
# branches:
6+
# - sapMachine
77
workflow_dispatch:
88

99
jobs:
@@ -30,7 +30,35 @@ jobs:
3030
with:
3131
distribution: 'sapmachine'
3232
java-version: '21'
33-
cache: ${{ matrix.build-system }}
33+
34+
35+
- name: Cache Maven packages
36+
if: matrix.build-system == 'maven'
37+
uses: actions/cache@v3
38+
with:
39+
path: ~/.m2/repository
40+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
41+
restore-keys: |
42+
${{ runner.os }}-maven-
43+
- name: Cache Gradle packages
44+
if: matrix.build-system == 'gradle'
45+
uses: actions/cache@v3
46+
with:
47+
path: |
48+
~/.gradle/caches
49+
~/.gradle/wrapper
50+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
51+
restore-keys: |
52+
${{ runner.os }}-gradle-
53+
- name: Cache SBT packages
54+
if: matrix.build-system == 'sbt'
55+
uses: actions/cache@v3
56+
with:
57+
path: |
58+
~/.sbt
59+
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt', '**/build.properties', '**/plugins.sbt') }}
60+
restore-keys: |
61+
${{ runner.os }}-sbt-
3462
3563
- name: Build with Maven
3664
if: matrix.build-system == 'maven'

.github/workflows/test-cache.yml

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test actions/cache with 'maven', 'gradle', 'sbt'
1+
name: Test cache option
22

33
on:
44
# push:
@@ -30,35 +30,7 @@ jobs:
3030
with:
3131
distribution: 'sapmachine'
3232
java-version: '21'
33-
34-
35-
- name: Cache Maven packages
36-
if: matrix.build-system == 'maven'
37-
uses: actions/cache@v3
38-
with:
39-
path: ~/.m2/repository
40-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
41-
restore-keys: |
42-
${{ runner.os }}-maven-
43-
- name: Cache Gradle packages
44-
if: matrix.build-system == 'gradle'
45-
uses: actions/cache@v3
46-
with:
47-
path: |
48-
~/.gradle/caches
49-
~/.gradle/wrapper
50-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
51-
restore-keys: |
52-
${{ runner.os }}-gradle-
53-
- name: Cache SBT packages
54-
if: matrix.build-system == 'sbt'
55-
uses: actions/cache@v3
56-
with:
57-
path: |
58-
~/.sbt
59-
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt', '**/build.properties', '**/plugins.sbt') }}
60-
restore-keys: |
61-
${{ runner.os }}-sbt-
33+
cache: ${{ matrix.build-system }}
6234

6335
- name: Build with Maven
6436
if: matrix.build-system == 'maven'

0 commit comments

Comments
 (0)