Skip to content

Commit

Permalink
Create cmake-win64-min.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenop authored Jun 9, 2024
1 parent 2761899 commit 6f7cd73
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/cmake-win64-min.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Build Tesseract on Windows using cmake. No Training Tools.
name: cmake-win64-min
on:
#push:
schedule:
- cron: 0 23 * * *
workflow_dispatch:

env:
ILOC: d:/a/local

jobs:
build:
name: cmake-win64-min
runs-on: windows-latest # windows-2019
steps:
- name: Uninstall Perl
run: |
choco uninstall strawberryperl
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Setup Installation Location
run: |
mkdir ${{env.ILOC}}/share/tessdata
- name: download extra files
shell: cmd
run: |
curl -L https://github.com/tesseract-ocr/tessdata/raw/main/eng.traineddata --output ${{env.ILOC}}/share/tessdata/eng.traineddata
curl -L https://github.com/tesseract-ocr/tessdata/raw/main/osd.traineddata --output ${{env.ILOC}}/share/tessdata/osd.traineddata
curl -L https://github.com/zdenop/test_ga/blob/main/testing/eurotext.bmp --output ${{env.ILOC}}/share/eurotext.bmp
curl -L https://github.com/unicode-org/icu/releases/download/release-75-1/icu4c-75_1-Win64-MSVC2022.zip --output icu4c-75_1-Win64-MSVC2022.zip
unzip.exe -qq icu4c-75_1-Win64-MSVC2022.zip -d ${{env.ILOC}}/
- name: Build and Install leptonica
shell: cmd
run: |
echo "Building leptonica..."
git clone --depth 1 https://github.com/DanBloomberg/leptonica.git
cd leptonica
cmake -G Ninja -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=${{env.ILOC}} -DCMAKE_INSTALL_PREFIX=${{env.ILOC}} -DSW_BUILD=OFF -DBUILD_PROG=OFF -DBUILD_SHARED_LIBS=ON
cmake --build build --target install
- name: Build and Install tesseract
id: build_tess
shell: cmd
run: |
git clone --depth 1 https://github.com/zdenop/tesseract.git
cd tesseract
cmake -G Ninja -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=${{env.ILOC}} -DCMAKE_INSTALL_PREFIX=${{env.ILOC}} -DSW_BUILD=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_TRAINING_TOOLS=ON -DOPENMP_BUILD=ON
cmake --build build --target install
- name: Upload Build Results
uses: actions/upload-artifact@v4
with:
name: tesseract-${{ steps.build_tess.outputs.version }}-VS2022_win64
path: ${{env.ILOC}}
retention-days: 7

- name: Display Tesseract Version and Test Command Line Usage
shell: cmd
run: |
echo "Setting TESSDATA_PREFIX..."
set TESSDATA_PREFIX=${{env.ILOC}}/share/tessdata
echo "Setting PATH..."
set PATH=${{env.ILOC}}/bin;%PATH%
echo "Checking installed tesseract version..."
tesseract -v
echo "Checking installed langs"
tesseract --list-langs
echo "Checking OCR process"
tesseract ${{env.ILOC}}/share/eurotext.bmp -

0 comments on commit 6f7cd73

Please sign in to comment.