github action 4 #4
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: Java Testing | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Check out the code | |
- name: Check out code | |
uses: actions/checkout@v3 | |
# Step 2: Set up JDK 23 (OpenJDK) | |
- name: Set up JDK 23 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '23' | |
distribution: 'temurin' | |
# Step 3: Grant execute permissions to the Gradle wrapper | |
- name: Grant execute permissions for Gradle wrapper | |
run: chmod +x ./gradlew | |
# Step 4: Build and test with Gradle | |
- name: Build and test with Gradle | |
run: ./gradlew clean test |