ci: caching with gradle-build-action

Allow for automatic capture of buildscan in job summary, and smarter
caching than the one provided by `setup-java`.
This commit is contained in:
validcube 2023-12-02 16:55:04 +07:00
parent de4e616dcc
commit a17a05995a
No known key found for this signature in database
GPG key ID: DBA94253E1D3F267
2 changed files with 16 additions and 11 deletions

View file

@ -17,17 +17,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Set up cache
uses: actions/cache@v3
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
path: |
${{ runner.home }}/.gradle/caches
${{ runner.home }}/.gradle/wrapper
.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
java-version: '17'
distribution: 'temurin'
- name: Set up Java
run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build with Gradle
env:

View file

@ -14,8 +14,16 @@ jobs:
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set up Java
run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-disabled: true
- name: Build with Gradle
env: