Fixed console warning #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: Maven Build with GraalVM | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up GraalVM with Java 21 | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
version: '21.3.0' # Utilisez la version de GraalVM souhaitée | |
java-version: '21' | |
components: native-image # Installe également le composant Native Image de GraalVM | |
- name: Set up Maven | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'graalvm' # Spécifie que nous utilisons GraalVM | |
java-version: '21' | |
- name: Cache Maven packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Build with Maven | |
run: mvn clean package | |
# Optionnel : Générer une image native avec GraalVM | |
- name: Build Native Image | |
run: | | |
mvn package -Pnative | |
if: success() # N'exécute cette étape que si la construction précédente a réussi |