Skip to content

Bump actions/setup-java from 3 to 4 (#423) #814

Bump actions/setup-java from 3 to 4 (#423)

Bump actions/setup-java from 3 to 4 (#423) #814

Workflow file for this run

# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Java CI with Gradle
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
checks: write
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v3
- name: Setup and execute tests via Gradle
uses: gradle/gradle-build-action@v3
with:
gradle-version: wrapper
arguments: test
- name: Publish Test Results
if: ${{ always() }}
uses: mikepenz/action-junit-report@v3
with:
report_paths: "**/TEST-*.xml"
exclude_sources: build/
annotate_only: ${{ github.event_name == 'pull_request' }}
style-check:
name: Code Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v3
- name: Verify all Java files are formatted correctly according to the Google Java Style Guide using Gradle
uses: gradle/gradle-build-action@v3
id: verifygooglejavaformat
with:
gradle-version: wrapper
arguments: spotlessJavaCheck
- name: Create summary if format check failed
if: ${{ steps.verifygooglejavaformat.outcome == 'failure' }}
run: |
echo "Run the command `./gradlew spotlessApply` to fix Java formatting." >> $GITHUB_STEP_SUMMARY