Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update build.yml to use gradle action
Browse files Browse the repository at this point in the history
specifies jdk to 17
uses official gradle github action which has built in caching.
jejking-tw authored Oct 24, 2023
1 parent 88e97cf commit 4ffbbce
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
name: Build and Test
name: Java CI with Gradle

on:
push:
branches: [ "master" ]
paths-ignore:
- '*.md'
pull_request:
branches: [ "master" ]
paths-ignore:
- '*.md'

permissions:
contents: read

jobs:
build-gradle:
name: Build and test in Gradle
build:

runs-on: ubuntu-latest

steps:
- name: Clone repository
uses: actions/checkout@master

- name: Restore Gradle caches
uses: actions/cache@master
env:
cache-name: gradle-cache
with:
path: ~/.gradle
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{hashFiles('**/build.gradle') }}
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- name: Run Gradle build and test
run: ./gradlew clean build
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Build with Gradle
uses: gradle/gradle-build-action@v2.9.0
with:
arguments: build

0 comments on commit 4ffbbce

Please sign in to comment.