graalvm / setup-graalvm

GitHub Action for setting up GraalVM distributions.
https://www.graalvm.org
Universal Permissive License v1.0
195 stars 28 forks source link

Caching Maven repository when building. #21

Closed chainhead closed 2 years ago

chainhead commented 2 years ago

How is Maven caching set-up when setting up GraalVM?

As per documentation, the following is an option to cache Maven dependencies.

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
  with:
    distribution: 'temurin'
    java-version: '17'
    cache: 'maven'
- name: Build with Maven
  run: mvn -B package --file pom.xml

My Maven command is mvn clean package -Pnative, btw.

What is the equivalent way to cache Maven when setting up GraalVM?

fniephaus commented 2 years ago

Just add "cache: 'maven'" to the setup-graalvm entry in your yml, it works the same way: https://github.com/graalvm/setup-graalvm#options

Also, I'm not sure you need the clean task, considering there should not be anything on the worker that needs cleaning.

Please let us know if you have any further questions!