ci-cd-test/.github/workflows/maven.yml
Maxime Pierront 3368b69c2d
All checks were successful
Java CI with Maven / build (push) Successful in 1m38s
update README.md
2024-10-19 16:48:17 +02:00

38 lines
768 B
YAML

name: Java CI with Maven
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
run: |
sudo apt-get update
sudo apt-get install -y openjdk-21-jdk
java -version
- name: Set up Maven
run: |
sudo apt-get install -y maven
mvn -version
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn -B compile
- name: Run tests
run: mvn -B test