Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build and test

on:
push:
branches:
- "**"
tags-ignore:
- "v*"
pull_request:
branches:
- "**"

jobs:
build:
name: Build
runs-on: ubuntu-latest

services:
postgres:
image: postgres:latest
ports:
- 5432:5432
env:
POSTGRES_DB: demo
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"

- name: Wait for Postgres
run: |
while ! pg_isready -h localhost -p 5432; do
echo "Waiting for postgres..."
sleep 1
done

- name: Run Build
env:
SPRING_DATASOURCE_URL: jdbc:postgresql://localhost:5432/demo
SPRING_DATASOURCE_USERNAME: postgres
SPRING_DATASOURCE_PASSWORD: password
run: ./gradlew clean build