Skip to content

Updated code, workflow and API doc added (#6) #1

Updated code, workflow and API doc added (#6)

Updated code, workflow and API doc added (#6) #1

Workflow file for this run

name: Java CI with Maven
on:
push:
branches:
- main
- JMEOS-working
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
- name: Uninstall any pre-installed Maven
run: |
sudo apt-get remove --purge -y maven
sudo rm -f /usr/bin/mvn
sudo rm -rf /usr/share/maven /etc/maven /usr/local/maven /opt/apache-maven*
- name: Install Maven 3.9.6
run: |
wget https://archive.apache.org/dist/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz
tar -xzf apache-maven-3.9.6-bin.tar.gz
sudo mv apache-maven-3.9.6 /opt/
sudo ln -s /opt/apache-maven-3.9.6/bin/mvn /usr/bin/mvn
mvn -version
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Print current working directory
run: pwd
# Install GEOS library
- name: Install GEOS
run: sudo apt-get install -y libgeos-dev
# Install PROJ library
- name: Install PROJ
run: sudo apt-get install proj-bin libproj-dev proj-data
# Install JSON-C library
- name: Install JSON-C
run: sudo apt install libjson-c-dev
# Fetch and install MEOS library
- name: Fetch MEOS sources
run: git clone https://github.com/MobilityDB/MobilityDB.git
# install MObilityDB
- name: Install MobilityDB
run: |
mkdir MobilityDB/build
cd MobilityDB/build
cmake .. -DMEOS=on
make -j
sudo make install
# Copy the installed library to your project's src/lib directory
- name: Copy MEOS library to JMEOS/src/lib
run: |
cp /usr/local/lib/libmeos.so $GITHUB_WORKSPACE/src/lib/
# Check for the library in the src/lib directory
- name: Check for the library
run: ls -la $GITHUB_WORKSPACE/src/lib
# Set up the environment variable LD_LIBRARY_PATH
- name: Set up LD_LIBRARY_PATH
run: echo "LD_LIBRARY_PATH=$(pwd)/src/lib" >> $GITHUB_ENV
# Check if libmeos.so exists in the target directory
- name: Check if libmeos.so exists
run: ls -l $LD_LIBRARY_PATH/libmeos.so
# Verify the architecture compatibility of the library
- name: Verify architecture compatibility
run: file $LD_LIBRARY_PATH/libmeos.so
# Test the MEOS library loading using ldd and nm
- name: Test libmeos.so loading
run: |
ldd $LD_LIBRARY_PATH/libmeos.so
nm -D $LD_LIBRARY_PATH/libmeos.so
# Ensure that the library has the correct execution permissions
- name: Ensure correct permissions
run: chmod +x $LD_LIBRARY_PATH/libmeos.so
# Build Maven project
- name: Build with Maven
run: mvn clean install