Skip to content

Implementing GitHub action work flow #5

Implementing GitHub action work flow

Implementing GitHub action work flow #5

Workflow file for this run

name: Ecommerce Microservices CI with Maven
on:
pull_request:
branches:
- master
jobs:
build:
name: Build All Modules (skip tests)
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build all modules (skipping tests)
run: mvn --batch-mode clean install -DskipTests
outputs:
build-status-key: ${{ steps.cache.outputs.cache-hit }}
test:
name: Run Tests
runs-on: ubuntu-latest
needs: build
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Run tests
run: mvn --batch-mode test
# pull_request:
# branches:
# - master
#jobs:
# build-and-test:
# runs-on: ubuntu-latest
#
# strategy:
# matrix:
# service: [product-service,
# order-service,
# inventory-service,
# api-gateway,
# config-server,
# eureka-server]
# steps:
# - name: Check out the repository
# uses: actions/checkout@v4
# - name: Set up JDK 17
# uses: actions/setup-java@v3
# with:
# java-version: '17'
# distribution: 'temurin'
# cache: maven
#
#
# - name: Build and test ${matrix.service}
# working-directory: ./${{ matrix.service }}
# run: mvn --batch-mode package