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
70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CI - Build and Test

on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
workflow_dispatch:

jobs:
build-and-test:
name: Build and Test treebase-core
runs-on: ubuntu-latest

permissions:
contents: read
checks: write
pull-requests: write

services:
postgres:
image: postgres:12
env:
POSTGRES_DB: treebasedb
POSTGRES_USER: treebase_user
POSTGRES_PASSWORD: treebase_pass
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: 'maven'

- name: Configure database properties for tests
run: |
mkdir -p /tmp/mesquite
cat > treebase-core/src/test/resources/jdbc.properties << EOF
jdbc.driverClassName=org.postgresql.Driver
jdbc.url=jdbc:postgresql://localhost:5432/treebasedb
jdbc.username=treebase_user
jdbc.password=treebase_pass
mesquite.folder_dir=/tmp/mesquite
EOF

- name: Build treebase-core
run: mvn -B clean compile -f treebase-core/pom.xml

- name: Run tests
run: mvn -B test -f treebase-core/pom.xml

- name: Publish Test Report
uses: dorny/test-reporter@v1
if: always()
with:
name: JUnit Test Results
path: treebase-core/target/surefire-reports/*.xml
reporter: java-junit
fail-on-error: true
Loading