Skip to content

Commit

Permalink
add osx
Browse files Browse the repository at this point in the history
  • Loading branch information
rzo1 committed Jan 17, 2025
1 parent d94809e commit a2fa96f
Showing 1 changed file with 47 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
pull_request:

jobs:
test-unix-shell:
test-unix-shell-ubuntu:
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -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 }}

0 comments on commit a2fa96f

Please sign in to comment.