Skip to content

Commit

Permalink
updated yml file
Browse files Browse the repository at this point in the history
  • Loading branch information
rachidassouani committed Jul 22, 2023
1 parent 9e9265b commit 54f8470
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 28 deletions.
44 changes: 17 additions & 27 deletions .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,30 @@ on:
paths:
- backend/**

env:
POSTGRES_USER: rachid
POSTGRES_PASSWORD: password
POSTGRES_DB: fullstackjava
JAVA_VERSION: 17

jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
image: postgres:15.3
env:
POSTGRES_USER: rachid
POSTGRES_PASSWORD: password
POSTGRES_DB: fullstackjava
POSTGRES_DB: ${{ env.POSTGRESQL_DB }}
POSTGRES_USER: ${{ env.POSTGRESQL_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRESQL_PASSWORD }}
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-timeout 5s
--health-retries 5
defaults:
run:
working-directory: /backend
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Wait for PostgreSQL to start
run: |
until pg_isready -h localhost -p 5432; do
sleep 2;
done
- name: Create database and initialize schema
run: |
psql -h localhost -U ${{ env.POSTGRES_USER }} -d ${{ env.POSTGRES_PASSWORD }} -c "CREATE DATABASE fullstackjava;"
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v2
- uses: actions/setup-java@v1.4.3
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Build and run Unit/Integration Tests with Maven
run: mvn -ntp -B verify
java-version: ${{ env.JAVA_VERSION }}
- name: Maven Clean Package
run: |
./mvnw --no-transfer-progress clean package -P build-frontend
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class FullStackJavaApplication {
public static void main(String[] args) {
SpringApplication.run(FullStackJavaApplication.class, args);
}

@Bean
CommandLineRunner commandLineRunner(CustomerRepository customerRepository) {
return args -> {
Expand Down

0 comments on commit 54f8470

Please sign in to comment.