tesseract/.github/workflows/autotools.yml

197 lines
5.7 KiB
YAML
Raw Normal View History

2021-01-24 19:56:15 +08:00
name: autotools
2021-01-27 01:02:54 +08:00
# autotools build of tesseract and training tools on ubuntu, macos homebrew and macports.
on:
2021-01-24 01:55:16 +08:00
#push:
schedule:
2021-01-24 19:56:15 +08:00
- cron: 0 20 * * *
jobs:
2021-01-24 19:56:15 +08:00
linux:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
2021-01-20 01:40:20 +08:00
compiler: [ g++, clang++ ]
2021-01-24 19:56:15 +08:00
compiler_version: [ 7, 8, 9, 10 ]
2021-01-20 13:10:38 +08:00
os: [ ubuntu-18.04, ubuntu-20.04 ]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
2021-01-24 19:56:15 +08:00
- name: Install compiler
run: |
sudo apt-get install -y ${{ matrix.compiler }}-${{ matrix.compiler_version }}
2021-01-18 01:13:56 +08:00
- name: Install dependencies
2021-01-20 01:40:20 +08:00
run: |
sudo apt-get install autoconf-archive libleptonica-dev libpango1.0-dev -y
2021-01-18 01:13:56 +08:00
2021-01-20 01:40:20 +08:00
- name: Setup
run: |
mkdir -p m4
./autogen.sh
2021-01-18 01:13:56 +08:00
- name: Configure
2021-01-27 01:02:54 +08:00
run: |
./configure '--disable-shared' 'CXX=${{ matrix.compiler }}-${{ matrix.compiler_version }}' 'CXXFLAGS=-g -O2'
2021-01-18 01:13:56 +08:00
2021-01-24 19:56:15 +08:00
- name: Make and Install Tesseract
run: |
make -j 8
sudo make install install
- name: Make and Install Training Tools
2021-01-20 01:40:20 +08:00
run: |
make training -j 8
sudo make install training-install
2021-01-20 01:40:20 +08:00
- name: Display Version
run: |
2021-01-24 19:56:15 +08:00
${{ matrix.compiler }}-${{ matrix.compiler_version }} --version
2021-01-20 01:40:20 +08:00
tesseract -v
lstmtraining -v
text2image -v
if: success() || failure()
2021-01-18 01:13:56 +08:00
- name: Download fonts, tessdata and langdata required for tests
2021-01-20 01:40:20 +08:00
run: |
git clone https://github.com/egorpugin/tessdata tessdata_unittest
cp tessdata_unittest/fonts/* test/testing/
mv tessdata_unittest/* ../
2021-01-24 19:56:15 +08:00
- name: Run Tesseract on phototest.tif and raaj.tif
2021-01-20 01:40:20 +08:00
run: |
tesseract test/testing/phototest.tif - --tessdata-dir ../tessdata
2021-01-24 19:56:15 +08:00
tesseract test/testing/raaj.tif - -l hin --tessdata-dir ../tessdata
2021-01-20 01:40:20 +08:00
2021-01-24 19:56:15 +08:00
homebrew:
2021-01-18 01:13:56 +08:00
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
2021-01-20 01:40:20 +08:00
compiler: [ g++, clang++ ]
2021-01-27 01:02:54 +08:00
os: [ macos-10.15 ]
2021-01-20 01:40:20 +08:00
2021-01-18 01:13:56 +08:00
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
2021-01-24 19:56:15 +08:00
2021-01-20 01:40:20 +08:00
- name: install dependencies
2021-01-18 01:13:56 +08:00
run: |
2021-01-20 01:40:20 +08:00
brew install automake autoconf-archive
brew install libarchive
brew install leptonica
brew install cairo pango
2021-01-18 01:13:56 +08:00
- name: Setup
run: |
2021-01-18 21:55:57 +08:00
mkdir -p m4
./autogen.sh
2021-01-18 01:13:56 +08:00
- name: Configure
run: |
2021-01-20 01:40:20 +08:00
./configure '--disable-shared' '--with-pic' 'CXX=${{ matrix.compiler }}' 'CXXFLAGS=-g -O2' 'PKG_CONFIG_PATH=/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/libarchive/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig'
2021-01-18 01:13:56 +08:00
2021-01-24 19:56:15 +08:00
- name: Make and Install Tesseract
2021-01-18 01:13:56 +08:00
run: |
2021-01-24 19:56:15 +08:00
make -j 8
sudo make install install
- name: Make and Install Training Tools
2021-01-18 01:13:56 +08:00
run: |
2021-01-24 19:56:15 +08:00
make training -j 8
sudo make install training-install
2021-01-20 01:40:20 +08:00
- name: Display Version
run: |
${{ matrix.compiler }} --version
tesseract -v
lstmtraining -v
text2image -v
if: success() || failure()
2021-01-18 21:55:57 +08:00
- name: Get fonts, tessdata and langdata required for unit tests
run: |
git clone https://github.com/egorpugin/tessdata tessdata_unittest
cp tessdata_unittest/fonts/* test/testing/
mv tessdata_unittest/* ../
2021-01-20 01:40:20 +08:00
2021-01-24 19:56:15 +08:00
- name: Run Tesseract on phototest.tif and raaj.tif
2021-01-20 01:40:20 +08:00
run: |
tesseract test/testing/phototest.tif - --tessdata-dir ../tessdata
2021-01-24 19:56:15 +08:00
tesseract test/testing/raaj.tif - -l hin --tessdata-dir ../tessdata
2021-01-20 01:40:20 +08:00
2021-01-24 19:56:15 +08:00
macports:
2021-01-18 21:55:57 +08:00
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
2021-01-20 01:40:20 +08:00
compiler: [ g++, clang++ ]
2021-01-20 13:10:38 +08:00
os: [ macos-10.15 ]
2021-01-20 01:40:20 +08:00
2021-01-18 21:55:57 +08:00
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
2021-01-20 01:40:20 +08:00
- name: Install Macports
2021-01-18 21:55:57 +08:00
run: |
2021-01-20 01:40:20 +08:00
curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci; source ./macports-ci install
2021-01-24 19:56:15 +08:00
2021-01-20 01:40:20 +08:00
- name: Install Dependencies
run: |
2021-01-24 01:55:16 +08:00
sudo port install \
autoconf autoconf-archive \
2021-01-20 01:40:20 +08:00
automake \
libtool \
pkgconfig \
leptonica
sudo port install cairo pango
sudo port install icu +devel
2021-01-18 21:55:57 +08:00
- name: Setup
run: |
mkdir -p m4
./autogen.sh
- name: Configure
run: |
2021-01-20 01:40:20 +08:00
./configure '--disable-shared' '--with-pic' 'CXX=${{ matrix.compiler }}' 'CXXFLAGS=-g -O2'
2021-01-18 21:55:57 +08:00
2021-01-24 19:56:15 +08:00
- name: Make and Install Tesseract
2021-01-18 21:55:57 +08:00
run: |
2021-01-24 19:56:15 +08:00
make -j 8
sudo make install install
- name: Make and Install Training Tools
2021-01-18 21:55:57 +08:00
run: |
2021-01-24 19:56:15 +08:00
make training -j 8
2021-01-18 21:55:57 +08:00
sudo make install training-install
2021-01-20 01:40:20 +08:00
- name: Display Version
run: |
tesseract -v
lstmtraining -v
text2image -v
if: success() || failure()
2021-01-18 21:55:57 +08:00
- name: Get fonts, tessdata and langdata required for unit tests
run: |
git clone https://github.com/egorpugin/tessdata tessdata_unittest
cp tessdata_unittest/fonts/* test/testing/
mv tessdata_unittest/* ../
2021-01-24 19:56:15 +08:00
- name: Run Tesseract on phototest.tif and raaj.tif
2021-01-20 01:40:20 +08:00
run: |
tesseract test/testing/phototest.tif - --tessdata-dir ../tessdata
2021-01-24 19:56:15 +08:00
tesseract test/testing/raaj.tif - -l hin --tessdata-dir ../tessdata
2021-01-29 13:07:43 +08:00
- name: Display Compiler Version
run: |
${{ matrix.compiler }} --version
git log -3 --pretty=format:'%h %ad %s | %an'
if: always()