Update maven-build.yml

This commit is contained in:
Kunchala Vikram 2023-12-30 22:25:14 +05:30 committed by GitHub
parent 70db3c7e32
commit a384f28a81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,26 +1,31 @@
# 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 CI with Maven
on:
push:
branches: [ main ]
branches: [ "master" ]
pull_request:
branches: [ main ]
branches: [ "master" ]
env:
IMAGE_NAME: "test-maven-app"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: maven
- name: Build with Maven Wrapper
run: ./mvnw -B package
- name: Checkout SCM
uses: actions/checkout@v3
- name: list workspace contents
run: ls -al ${{ github.workspace }}
- name: Setup Java and Maven
uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '11'
- name: Check java and mvn version
run: |
java -version
mvn --version
- name: Run Tests
run: mvn test
- name: Package the Application
run: |
mvn -B package
ls -al ${{ github.workspace }}/target