-
Notifications
You must be signed in to change notification settings - Fork 44
50 lines (42 loc) · 1.39 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Pre-merge checks
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-and-test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: wow_some_password_bud
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 5432:5432
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
- name: Configure DB
run: |
psql -h localhost -U postgres -c "CREATE DATABASE example_app;"
psql -h localhost -U postgres -c "CREATE USER example_user WITH PASSWORD 's3cr3t';"
psql -h localhost -U postgres -d example_app -f droptools-example/src/main/resources/db/migration/20141010__init.sql
psql -h localhost -U postgres -c "GRANT ALL ON DATABASE example_app TO example_user;"
psql -h localhost -U postgres -d example_app -c "GRANT ALL ON ALL TABLES IN SCHEMA ex TO example_user;"
env:
PGPASSWORD: wow_some_password_bud
- name: Generate DB code
run: ./gradlew droptools-example:generateJooq
- name: Build and run tests
run: ./gradlew check