This is an automated email from the ASF dual-hosted git repository.

rzo1 pushed a commit to branch OPENNLP-1688
in repository https://gitbox.apache.org/repos/asf/opennlp.git

commit a2fa96f943a59757c2256f4b4086e67227676a52
Author: Richard Zowalla <r...@apache.org>
AuthorDate: Fri Jan 17 12:51:59 2025 +0100

    add osx
---
 .../{shell-tests.yml => unix-shell-tests.yml}      | 48 +++++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/shell-tests.yml 
b/.github/workflows/unix-shell-tests.yml
similarity index 64%
rename from .github/workflows/shell-tests.yml
rename to .github/workflows/unix-shell-tests.yml
index dccce581..1758e330 100644
--- a/.github/workflows/shell-tests.yml
+++ b/.github/workflows/unix-shell-tests.yml
@@ -22,7 +22,7 @@ on:
   pull_request:
 
 jobs:
-  test-unix-shell:
+  test-unix-shell-ubuntu:
     runs-on: ubuntu-latest
 
     steps:
@@ -76,3 +76,49 @@ jobs:
         env:
           JAVA_HOME: ${{ env.JAVA_HOME }}
           OPENNLP_HOME: ${{ env.OPENNLP_HOME }}
+
+  test-unix-shell-macos:
+    name: Test on macOS
+    runs-on: macos-latest
+
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v4
+
+      - name: Install Bats (Testing Framework)
+        run: |
+          brew update
+          brew install bats-core
+
+      - name: Set up JDK 17
+        uses: actions/setup-java@v4
+        with:
+          distribution: temurin
+          java-version: 17
+
+      - name: Build with Maven
+        run: mvn -V clean install --no-transfer-progress -Pci -DskipTests=true
+
+      - name: Find and Extract OpenNLP Distribution
+        run: |
+          TAR_FILE=$(find opennlp-distr/target -maxdepth 1 -type f -name 
"*.tar.gz" ! -name "*-src*.tar.gz" | head -n 1)
+          if [ -z "$TAR_FILE" ]; then
+            echo "Error: No matching tar.gz file found in opennlp-distr/target"
+            exit 1
+          fi
+          tar -xzf "$TAR_FILE" -C $HOME
+          EXTRACTED_DIR=$(tar -tf "$TAR_FILE" | head -n 1 | cut -f1 -d"/")
+          echo "OPENNLP_HOME=$HOME/$EXTRACTED_DIR" >> $GITHUB_ENV
+          echo "$HOME/$EXTRACTED_DIR/bin" >> $GITHUB_PATH
+
+      - name: Verify Extraction
+        run: |
+          echo "OPENNLP_HOME: $OPENNLP_HOME"
+          ls -l $OPENNLP_HOME/bin
+
+      - name: Run Bats Tests
+        run: |
+          bats ./opennlp-distr/src/test/sh
+        env:
+          JAVA_HOME: ${{ env.JAVA_HOME }}
+          OPENNLP_HOME: ${{ env.OPENNLP_HOME }}
\ No newline at end of file

Reply via email to