Skip to content

Develop

Develop #65

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Build with Maven
run: ./mvnw clean compile
- name: Generate SBE sources
run: ./mvnw generate-sources
- name: Run tests with JaCoCo
run: ./mvnw clean test jacoco:report -Pcoverage
- name: Check coverage thresholds
run: |
COVERAGE=$(grep -oP '(?<=Total.*?">).*?(?=%</td>)' target/site/jacoco/index.html | head -1)
echo "Coverage: $COVERAGE%"
if (( $(echo "$COVERAGE < 15" | bc -l) )); then
echo "❌ Coverage ($COVERAGE%) is below minimum threshold (15%)"
exit 1
else
echo "✅ Coverage ($COVERAGE%) meets minimum threshold (15%)"
fi