Update maven.yml using PostgreSQL on build system
Update maven.yml using PostgreSQL on build system
This commit is contained in:
parent
9d92e7e4d1
commit
6a289ddf5d
1 changed files with 32 additions and 17 deletions
49
.github/workflows/maven.yml
vendored
49
.github/workflows/maven.yml
vendored
|
|
@ -1,7 +1,7 @@
|
|||
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
||||
|
||||
name: Java 8 CI with Maven and skipTests
|
||||
name: Ubuntu 20.04 Java 8 CI with Maven, PostgreSQL and skipTests option
|
||||
|
||||
on:
|
||||
push:
|
||||
|
|
@ -12,26 +12,41 @@ on:
|
|||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
env:
|
||||
POSTGRES_DB: libreplandev
|
||||
POSTGRES_PASSWORD: libreplan
|
||||
POSTGRES_USER: libreplan
|
||||
ports:
|
||||
- 5432:5432
|
||||
# Set health checks to wait until postgres has started
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
# services:
|
||||
# postgres:
|
||||
# image: postgres:latest
|
||||
# env:
|
||||
# POSTGRES_DB: libreplandev
|
||||
# POSTGRES_PASSWORD: libreplan
|
||||
# POSTGRES_USER: libreplan
|
||||
# ports:
|
||||
# - 5432:5432
|
||||
# # Set health checks to wait until postgres has started
|
||||
# options: >-
|
||||
# --health-cmd pg_isready
|
||||
# --health-interval 10s
|
||||
# --health-timeout 5s
|
||||
# --health-retries 5
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Start PostgreSQL on Ubuntu
|
||||
run: |
|
||||
sudo systemctl start postgresql.service
|
||||
pg_isready
|
||||
|
||||
- name: Create scheduler user
|
||||
run: |
|
||||
sudo -u postgres psql --command="CREATE USER libreplan PASSWORD 'libreplan'" --command="\du"
|
||||
|
||||
- name: Create timetable database
|
||||
run: |
|
||||
sudo -u postgres createdb --owner=libreplan libreplan
|
||||
PGPASSWORD=libreplan psql --username=libreplan --host=localhost --list libreplan
|
||||
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue