forked from valentinajemuovic/banking-kata-java
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (81 loc) · 2.69 KB
/
ci.yaml
File metadata and controls
85 lines (81 loc) · 2.69 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: CI
on: [push, pull_request]
jobs:
build-job:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: postgres_db
POSTGRES_PORT: 5432
POSTGRES_USER: postgres_usr
POSTGRES_PASSWORD: postgres_pwd
ports:
- 5432:5432
options:
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 3
mongodb:
image: mongo
ports:
- 27017:27017
env:
MONGO_INITDB_ROOT_USERNAME: rootuser
MONGO_INITDB_ROOT_PASSWORD: rootpass
mongo-express:
image: mongo-express
ports:
- 8081:8081
env:
ME_CONFIG_MONGODB_ADMINUSERNAME: rootuser
ME_CONFIG_MONGODB_ADMINPASSWORD: rootpass
ME_CONFIG_MONGODB_SERVER: mongodb
steps:
- name: Update Packages
run:
sudo apt-get update
- name: Install Postgresql client
run:
sudo apt-get install --yes postgresql-client
- name: Check database connectivity
run: psql -h localhost -d postgres_db -U postgres_usr -c 'SELECT 1;'
env:
PGPASSWORD: postgres_pwd
- name: Checkout
uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: 17
distribution: 'adopt'
- name: Gradle Build & Unit Tests
run: ./gradlew build
env:
POSTGRES_URL: jdbc:postgresql://localhost:5432/postgres_db
POSTGRES_USER: postgres_usr
POSTGRES_PASSWORD: postgres_pwd
MONGO_INITDB_ROOT_USERNAME: rootuser
MONGO_INITDB_ROOT_PASSWORD: rootpass
ME_CONFIG_MONGODB_ADMINUSERNAME: rootuser
ME_CONFIG_MONGODB_ADMINPASSWORD: rootpass
ME_CONFIG_MONGODB_SERVER: mongodb
KEYCLOAK_REALM_URL: http://localhost:10000/auth/realms/banking-kata
KEYCLOAK_TEST_CLIENT_ID: test-client
KEYCLOAK_TEST_CLIENT_SECRET: XXXX
- name: Gradle Integration Tests
run: ./gradlew integrationTest
env:
POSTGRES_URL: jdbc:postgresql://localhost:5432/postgres_db
POSTGRES_USER: postgres_usr
POSTGRES_PASSWORD: postgres_pwd
MONGO_INITDB_ROOT_USERNAME: rootuser
MONGO_INITDB_ROOT_PASSWORD: rootpass
ME_CONFIG_MONGODB_ADMINUSERNAME: rootuser
ME_CONFIG_MONGODB_ADMINPASSWORD: rootpass
ME_CONFIG_MONGODB_SERVER: mongodb
KEYCLOAK_REALM_URL: http://localhost:10000/auth/realms/banking-kata
KEYCLOAK_TEST_CLIENT_ID: test-client
KEYCLOAK_TEST_CLIENT_SECRET: XXXX