Retry with Postgres service

This commit is contained in:
Jeroen Baten 2022-06-16 21:21:07 +02:00 committed by GitHub
parent b6a6b32e11
commit eeec0d51c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,43 +14,43 @@ jobs:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
# services: services:
# postgres: postgres:
# image: postgres:latest image: postgres:13.0
# env: env:
# POSTGRES_DB: libreplandev POSTGRES_DB: libreplandev
# POSTGRES_PASSWORD: libreplan POSTGRES_PASSWORD: libreplan
# POSTGRES_USER: libreplan POSTGRES_USER: libreplan
# ports: ports:
# - 5432:5432 - 5432:5432
# # Set health checks to wait until postgres has started # Set health checks to wait until postgres has started
# options: >- options: >-
# --health-cmd pg_isready --health-cmd pg_isready
# --health-interval 10s --health-interval 10s
# --health-timeout 5s --health-timeout 5s
# --health-retries 5 --health-retries 5
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Start PostgreSQL on Ubuntu # - name: Start PostgreSQL on Ubuntu
run: | # run: |
sudo systemctl start postgresql.service # sudo systemctl start postgresql.service
pg_isready # pg_isready
- name: Set scram password encryption # - name: Set scram password encryption
run: | # run: |
sudo -u postgres psql --command="ALTER SYSTEM SET password_encryption = 'scram-sha-256';" # sudo -u postgres psql --command="ALTER SYSTEM SET password_encryption = 'scram-sha-256';"
- name: Create libreplan user # - name: Create libreplan user
run: | # run: |
sudo -u postgres psql --command="CREATE USER libreplan PASSWORD 'libreplan'; " # sudo -u postgres psql --command="CREATE USER libreplan PASSWORD 'libreplan'; "
#" --command="\du" ##" --command="\du"
- name: Create libreplandev database # - name: Create libreplandev database
run: | # run: |
sudo -u postgres createdb --owner=libreplan libreplandev # sudo -u postgres createdb --owner=libreplan libreplandev
PGPASSWORD=libreplan psql --username=libreplan --host=localhost --list libreplandev # PGPASSWORD=libreplan psql --username=libreplan --host=localhost --list libreplandev
- name: Set up JDK 8 - name: Set up JDK 8
uses: actions/setup-java@v3 uses: actions/setup-java@v3