Skip to content

Switch caching to actions/setup-java to cache maven #1186

Switch caching to actions/setup-java to cache maven

Switch caching to actions/setup-java to cache maven #1186

Workflow file for this run

# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches: [ master, '*.*' ]
paths-ignore:
- '.idea/**'
- '.run/**'
pull_request:
branches: [ master, '*.*' ]
paths-ignore:
- '.idea/**'
- '.run/**'
env:
SPARK_LOCAL_IP: 127.0.0.1
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
cache: 'maven'
- name: Cache Maven Packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-
- name: Build with Maven
run: mvn -B --no-transfer-progress package --file pom.xml -Dsurefire.skipAfterFailureCount=1