mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-11 23:19:04 +08:00
110 lines
3.7 KiB
YAML
110 lines
3.7 KiB
YAML
name: vcpkg-4.1.1
|
|
# build tesseract 4.1 using vcpkg and cmake on ubuntu and windows.
|
|
# build and run basicapitest on windows.
|
|
# macos fails on leptonica build - https://github.com/microsoft/vcpkg/issues/16116
|
|
on:
|
|
#push:
|
|
schedule:
|
|
- cron: 0 22 1 * *
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest ]
|
|
|
|
steps:
|
|
- name: Checkout Tesseract Source (for test images)
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install vcpkg (Linux)
|
|
run: |
|
|
git clone https://github.com/microsoft/vcpkg
|
|
vcpkg/bootstrap-vcpkg.sh
|
|
vcpkg/vcpkg integrate install
|
|
if: runner.os == 'Linux'
|
|
|
|
- name: Build Tesseract 4.1.1 (Linux)
|
|
run: |
|
|
vcpkg/vcpkg install tesseract:x64-linux
|
|
if: runner.os == 'Linux'
|
|
|
|
- name: Visual Studio Setup (Windows)
|
|
shell: cmd
|
|
run: |
|
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
|
if: runner.os == 'Windows'
|
|
|
|
- name: Install vcpkg (Windows)
|
|
run: |
|
|
git clone https://github.com/microsoft/vcpkg
|
|
vcpkg/bootstrap-vcpkg.bat
|
|
vcpkg/vcpkg integrate install
|
|
if: runner.os == 'Windows'
|
|
|
|
- name: Build and Install Tesseract and dependencies using vcpkg (Windows)
|
|
run: |
|
|
vcpkg/vcpkg install tesseract:x64-windows
|
|
if: runner.os == 'Windows'
|
|
|
|
- name: Download tessdata used for tests
|
|
run: |
|
|
git clone https://github.com/egorpugin/tessdata tessdata_unittest
|
|
mv tessdata_unittest/* ../
|
|
if: runner.os == 'Windows'
|
|
|
|
- name: Create CMakeLists.txt file for basicapitest
|
|
shell: bash
|
|
run: |
|
|
cd test
|
|
cat << "EOF" > CMakeLists.txt
|
|
cmake_minimum_required(VERSION 3.19)
|
|
project( basicapitest )
|
|
find_package( Tesseract REQUIRED )
|
|
find_package( Leptonica REQUIRED )
|
|
include_directories(${Tesseract_INCLUDE_DIRS})
|
|
include_directories(${Leptonica_INCLUDE_DIRS})
|
|
add_executable( basicapitest testing/basicapitest.cpp )
|
|
target_link_libraries(basicapitest ${Leptonica_LIBRARIES})
|
|
target_link_libraries(basicapitest ${Tesseract_LIBRARIES})
|
|
target_link_libraries(basicapitest libtesseract)
|
|
EOF
|
|
cat CMakeLists.txt
|
|
if: runner.os == 'Windows'
|
|
|
|
- name: Configure basicapitest
|
|
run: |
|
|
cd test
|
|
cmake . "-DCMAKE_TOOLCHAIN_FILE=${env:GITHUB_WORKSPACE}/vcpkg/scripts/buildsystems/vcpkg.cmake"
|
|
if: runner.os == 'Windows'
|
|
|
|
- name: Build basicapitest
|
|
run: |
|
|
cd test
|
|
cmake --build . --config Release
|
|
if: runner.os == 'Windows'
|
|
|
|
- name: Run basicapitest (Windows)
|
|
run: |
|
|
cd test
|
|
D:\a\tesseract\tesseract\test\Release\basicapitest.exe
|
|
if: runner.os == 'Windows'
|
|
|
|
- name: Build Tesseract 4.1.1 (macOS) Leptonica build fails
|
|
run: |
|
|
git clone https://github.com/microsoft/vcpkg
|
|
vcpkg/bootstrap-vcpkg.sh
|
|
vcpkg/vcpkg integrate install
|
|
vcpkg install leptonica:x64-osx
|
|
vcpkg install tesseract:x64-osx
|
|
if: runner.os == 'macOS'
|
|
|
|
- name: Display Leptonica error log (macOS) Fails
|
|
run: |
|
|
cat /usr/local/share/vcpkg/buildtrees/leptonica/install-x64-osx-dbg-out.log
|
|
if: ${{ runner.os == 'macOS' && always() }}
|