Skip to content

Commit e54146f

Browse files
authored
Merge pull request #3 from RappyLabyAddons/development
feat: Add caching to speed up GitHub builds
2 parents a1e51c1 + 531ceaf commit e54146f

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: LabyAddon Build
22

33
on:
44
push:
5-
branches: [ "master", "main" ]
5+
branches: [ "master" ]
66
pull_request:
7-
branches: [ "master", "main" ]
7+
branches: [ "master" ]
88
workflow_dispatch:
99

1010
jobs:
@@ -17,6 +17,20 @@ jobs:
1717
with:
1818
distribution: 'corretto'
1919
java-version: '21'
20+
- name: Cache Gradle dependencies
21+
uses: actions/cache@v4
22+
with:
23+
path: ~/.gradle/caches
24+
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
25+
restore-keys: |
26+
gradle-${{ runner.os }}-
27+
- name: Cache Gradle wrapper
28+
uses: actions/cache@v4
29+
with:
30+
path: ~/.gradle/wrapper
31+
key: gradle-wrapper-${{ runner.os }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
32+
restore-keys: |
33+
gradle-wrapper-${{ runner.os }}-
2034
- name: Grant execute permission for gradlew
2135
run: chmod +x gradlew
2236
- name: Build with Gradle

0 commit comments

Comments
 (0)