Skip to content

Commit

Permalink
Merge branch 'main' of github.com:hanspeterdietiker/A3-project-restau…
Browse files Browse the repository at this point in the history
…rant-api
  • Loading branch information
Gabrielsilvamagalhaes committed May 25, 2024
2 parents 9e47df2 + f133048 commit 696df88
Showing 1 changed file with 37 additions and 20 deletions.
57 changes: 37 additions & 20 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,43 @@
name: Project Java with Maven - Restaurant
name: Java CI with Maven

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file Restaurant-Api/pom.xml

services:
postgres:
image: postgres:latest
ports:
- 5432:5432
env:
POSTGRES_DB: project-api-restaurant
POSTGRES_USER: user
POSTGRES_PASSWORD: password
options: >-
--health-cmd "pg_isready -U user"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: List files
run: ls -la
- name: Build with Maven
run: mvn -B package --file Restaurant-Api/pom.xml
- name: Run tests
working-directory: Restaurant-Api/src/test/java/com/restaurant/a3/RestaurantApi
run: mvn test
env:
SPRING_DATASOURCE_URL: jdbc:postgresql://localhost:5432/project-api-restaurant
SPRING_DATASOURCE_USERNAME: user
SPRING_DATASOURCE_PASSWORD: password

0 comments on commit 696df88

Please sign in to comment.