Add GitHub Actions workflow for compilation #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| cache: 'maven' | |
| - name: Build all modules | |
| run: | | |
| set -e # Exit on first compilation error | |
| # Store the root directory | |
| ROOT_DIR=$(pwd) | |
| # Find all pom.xml files and build them | |
| find . -name pom.xml -not -path "*/target/*" | while read pom; do | |
| PROJECT_DIR=$(dirname "$pom") | |
| echo "Building $PROJECT_DIR" | |
| # Change to project directory and compile | |
| cd "$ROOT_DIR/$PROJECT_DIR" | |
| mvn clean compile -B -q || { | |
| echo "Failed to compile $PROJECT_DIR" | |
| exit 1 | |
| } | |
| done | |
| echo "All modules compiled successfully" |