File tree Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and test
2+
3+ on :
4+ push :
5+ branches :
6+ - " **"
7+ tags-ignore :
8+ - " v*"
9+ pull_request :
10+ branches :
11+ - " **"
12+
13+ jobs :
14+ build :
15+ name : Build
16+ runs-on : ubuntu-latest
17+
18+ services :
19+ postgres :
20+ image : postgres:latest
21+ ports :
22+ - 5432:5432
23+ env :
24+ POSTGRES_DB : demo
25+ POSTGRES_USER : postgres
26+ POSTGRES_PASSWORD : password
27+ options : >-
28+ --health-cmd pg_isready
29+ --health-interval 10s
30+ --health-timeout 5s
31+ --health-retries 5
32+
33+ steps :
34+ - name : Checkout repository
35+ uses : actions/checkout@v4
36+ with :
37+ submodules : " recursive"
38+
39+ - name : Setup Java
40+ uses : actions/setup-java@v4
41+ with :
42+ java-version : " 17"
43+ distribution : " temurin"
44+
45+ - name : Wait for Postgres
46+ run : |
47+ while ! pg_isready -h localhost -p 5432; do
48+ echo "Waiting for postgres..."
49+ sleep 1
50+ done
51+
52+ - name : Run Build
53+ env :
54+ SPRING_DATASOURCE_URL : jdbc:postgresql://localhost:5432/demo
55+ SPRING_DATASOURCE_USERNAME : postgres
56+ SPRING_DATASOURCE_PASSWORD : password
57+ run : ./gradlew clean build
58+
You can’t perform that action at this time.
0 commit comments