Repository navigation
Updated Release tag in readme #189
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: Java CI with Maven | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: maven | |
| # ---------------------------- | |
| # Linux / macOS installation | |
| # ---------------------------- | |
| - name: Install Tesseract OCR (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: | | |
| if [ "$RUNNER_OS" = "Linux" ]; then | |
| echo "Installing Tesseract on Ubuntu..." | |
| sudo apt-get update | |
| sudo apt-get install -y tesseract-ocr tesseract-ocr-eng tesseract-ocr-fra | |
| else | |
| echo "Installing Tesseract on macOS..." | |
| brew update | |
| brew install tesseract | |
| echo "Adding French language data..." | |
| sudo mkdir -p /usr/local/share/tessdata | |
| sudo curl -L -o /usr/local/share/tessdata/fra.traineddata \ | |
| https://github.com/tesseract-ocr/tessdata_best/raw/main/fra.traineddata | |
| fi | |
| # ---------------------------- | |
| # Windows installation (via winget) | |
| # ---------------------------- | |
| - name: Install Tesseract OCR (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| Write-Host "Installing Tesseract on Windows via winget..." | |
| winget install --id UB-Mannheim.TesseractOCR -e --accept-package-agreements --accept-source-agreements | |
| # Add Tesseract path | |
| "C:\Program Files\Tesseract-OCR" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| # Add French language | |
| $tessdata = "C:\Program Files\Tesseract-OCR\tessdata" | |
| if (!(Test-Path $tessdata)) { New-Item -ItemType Directory -Path $tessdata | Out-Null } | |
| Invoke-WebRequest ` | |
| -Uri "https://github.com/tesseract-ocr/tessdata_best/raw/main/fra.traineddata" ` | |
| -OutFile "$tessdata\fra.traineddata" | |
| Write-Host "✅ Tesseract + fra.traineddata installed successfully via winget." | |
| # ---------------------------- | |
| # Verify installation | |
| # ---------------------------- | |
| - name: Verify Tesseract installation | |
| shell: bash | |
| run: | | |
| echo "🔍 Checking installed Tesseract version and languages..." | |
| tesseract --version | |
| echo "Available languages:" | |
| tesseract --list-langs || echo "⚠️ Could not list languages" | |
| # ---------------------------- | |
| # Build & Test | |
| # ---------------------------- | |
| - name: Build and test with Maven | |
| run: mvn -B verify --file pom.xml |