refactoring on spring tests #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Gradle CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
JAVA_VERSION: 21 | |
GRADLE_VERSION: '8.5' # Adjust if you want a different Gradle version | |
CACHE_KEY: gradle-local-repo | |
GRADLE_TASKS: build # Define your Gradle tasks here | |
jobs: | |
build: | |
name: 'Build & Test' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ env.JAVA_VERSION }} | |
- name: Install Gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-version: ${{ env.GRADLE_VERSION }} | |
- name: Cache Gradle packages | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ env.CACHE_KEY }}-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ env.CACHE_KEY }}-${{ runner.os }}- | |
- name: Gradle Build | |
run: gradle ${{ env.GRADLE_TASKS }} |