tesseract/.github/workflows/cmake-win64.yml
2021-04-06 17:15:08 +00:00

143 lines
5.9 KiB
YAML

# Based on https://github.com/zdenop/tesserocr/actions/runs/691257659/workflow
# Build Tesseract on Windows using cmake. No Training Tools.
name: cmake-win64
on:
push:
schedule:
- cron: 0 23 * * *
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows Latest MSVC - cmake",
os: windows-latest,
cc: "cl",
cxx: "cl",
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
- name: Build and Install leptonica dependencies
shell: cmd
run: |
mkdir d:/a/local
set PKG_CONFIG_PATH=d:/a/local/lib/pkgconfig
echo "PKG_CONFIG_PATH=d:/a/local/lib/pkgconfig" >> $GITHUB_ENV
- name: Build and Install zlib
shell: cmd
run: |
curl -sSL -o zlib1211.zip https://zlib.net/zlib1211.zip
unzip.exe zlib1211.zip
cd zlib-1.2.11
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=d:/a/local -DCMAKE_INSTALL_PREFIX=d:/a/local
cmake --build build --config Release --target install
- name: Build and Install libpng
shell: cmd
run: |
curl -sSL -o lpng1637.zip https://vorboss.dl.sourceforge.net/project/libpng/libpng16/1.6.37/lpng1637.zip
unzip.exe lpng1637.zip
cd lpng1637
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=d:/a/local -DCMAKE_INSTALL_PREFIX=d:/a/local
cmake --build build --config Release --target install
- name: Build and Install webp
shell: cmd
run: |
git clone --depth 1 https://github.com/webmproject/libwebp.git && cd libwebp
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=d:/a/local -DCMAKE_INSTALL_PREFIX=d:/a/local
cmake --build build --config Release --target install
- name: Build and Install giflib
shell: cmd
run: |
curl -sSL -o giflib-master.zip https://codeload.github.com/xbmc/giflib/zip/master
unzip giflib-master.zip
cd giflib-master
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=d:/a/local -DCMAKE_INSTALL_PREFIX=d:/a/local
cmake --build build --config Release --target install
- name: Build and Install libjpeg
shell: cmd
run: |
git clone --depth 1 https://github.com/libjpeg-turbo/libjpeg-turbo.git
cd libjpeg-turbo
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=d:/a/local -DCMAKE_INSTALL_PREFIX=d:/a/local
cmake --build build --config Release --target install
- name: Build and Install openjpeg
shell: cmd
run: |
git clone --depth 1 https://github.com/uclouvain/openjpeg.git
cd openjpeg
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=d:/a/local -DCMAKE_INSTALL_PREFIX=d:/a/local
cmake --build build --config Release --target install
cd ..
- name: Build and Install jbigkit
shell: cmd
run: |
git clone --depth 1 https://github.com/zdenop/jbigkit
cd jbigkit-2.1
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=d:/a/local -DCMAKE_INSTALL_PREFIX=d:/a/local
cmake --build build --config Release --target install
cd ..
- name: Build and Install zstd
shell: cmd
run: |
git clone --depth 1 https://github.com/facebook/zstd.git
cd zstd
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=d:/a/local -DCMAKE_INSTALL_PREFIX=d:/a/local
cmake --build build --config Release --target install
cd ..
- name: Build and Install libtiff
shell: cmd
run: |
git clone --depth 1 https://gitlab.com/libtiff/libtiff
cd libtiff
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=d:/a/local -DCMAKE_INSTALL_PREFIX=d:/a/local
cmake --build build --config Release --target install
cd ..
- name: Build and Install leptonica
shell: cmd
run: |
echo "Building leptonica..."
git clone --depth 1 https://github.com/DanBloomberg/leptonica.git && cd leptonica
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_PROG=OFF -DSW_BUILD=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_PREFIX_PATH=d:/a/local -DCMAKE_INSTALL_PREFIX=d:/a/local
cmake --build build --config Release --target install
- name: Build and Install tesseract
shell: cmd
run: |
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_TRAINING_TOOLS=OFF -DSW_BUILD=OFF -DBUILD_SHARED_LIBS=ON -DOPENMP_BUILD=OFF -DCMAKE_PREFIX_PATH=d:/a/local -DCMAKE_INSTALL_PREFIX=d:/a/local
cmake --build build --config Release --target install
- name: Display Tesseract Version and Test Comman Line Usage
shell: cmd
run: |
git clone --depth 1 https://github.com/tesseract-ocr/tessconfigs
mkdir d:/a/local/share
move tessconfigs d:/a/local/share
curl -L https://github.com/tesseract-ocr/tessdata/raw/master/eng.traineddata --output d:/a/local/share/tessconfigs/eng.traineddata
curl -L https://github.com/tesseract-ocr/tessdata/raw/master/osd.traineddata --output d:/a/local/share/tessconfigs/osd.traineddata
set TESSDATA_PREFIX=d:/a/local/share/tessconfigs
set PATH=d:/a/local/bin;%PATH%
tesseract -v
tesseract --list-langs
tesseract test/testing/phototest.tif -