Skip to content

Merge pull request #25 from eliasnogueira/libraries-update #84

Merge pull request #25 from eliasnogueira/libraries-update

Merge pull request #25 from eliasnogueira/libraries-update #84

name: Build and Test
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
test-run:
description: 'Run Tests (y/n)?'
required: true
default: 'y'
jobs:
build:
runs-on: ubuntu-latest
services:
credit-api:
image: eliasnogueira/combined-credit-api:latest
ports:
- 8088:8088
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: adopt
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Wait for the backend service to start
run: wget -qO- https://raw.githubusercontent.com/eficode/wait-for/$WAIT_FOR_VERSION/wait-for | sh -s -- http://localhost:8088/actuator/health -t 30 -- echo "Backend is up"
env:
WAIT_FOR_VERSION: 4df3f9262d84cab0039c07bf861045fbb3c20ab7
- name: Build with Maven
run: mvn -q -B -DskipTests package --file pom.xml
- name: Run Health Check Tests
run: mvn -q -B test -Dgroups="health"
- name: Run Contract Tests
run: mvn -q -B test -Dgroups="contract"
- name: Run E2E Tests
run: mvn -q -B test -Dgroups="e2e"
- name: Run Functional Tests
run: mvn -q -B test -Dgroups="functional"