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