build and test

This commit is contained in:
Rodolphe Fontaine 2024-10-16 10:39:49 +02:00
parent 77a096b7f1
commit 631fcba8a3
3 changed files with 12 additions and 35 deletions

View file

@ -10,15 +10,15 @@ on:
branches: [ main ] branches: [ main ]
jobs: jobs:
build: build_and_test:
name: Build and Test
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
java: [ '17' ] java: [ '17' ]
steps: steps:
- uses: actions/checkout@v4 - name: checkout Git repository
uses: actions/checkout@v4
- name: Set up JDK ${{matrix.java}} - name: Set up JDK ${{matrix.java}}
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
@ -27,3 +27,11 @@ jobs:
cache: maven cache: maven
- name: Build with Maven Wrapper - name: Build with Maven Wrapper
run: ./mvnw -B package run: ./mvnw -B package
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: TEST with Maven Wrapper
run: ./mvnw -B test

View file

@ -1,29 +0,0 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java TESTS with Maven
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '17' ]
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{matrix.java}}
uses: actions/setup-java@v4
with:
java-version: ${{matrix.java}}
distribution: 'adopt'
cache: maven
- name: TEST with Maven Wrapper
run: ./mvnw -B test

View file

@ -15,8 +15,6 @@ jobs:
java-version: ${{matrix.java}} java-version: ${{matrix.java}}
distribution: 'adopt' distribution: 'adopt'
cache: maven cache: maven
- name: Build with Maven Wrapper
run: ./mvnw spring-boot:run
- name: Run JMeter Action on a test - name: Run JMeter Action on a test
uses: rbhadti94/apache-jmeter-action@v0.5.0 uses: rbhadti94/apache-jmeter-action@v0.5.0
with: with: