2021-01-14 17:25:21 +08:00
|
|
|
name: dailyunittest
|
|
|
|
|
|
|
|
on:
|
2021-01-24 01:55:16 +08:00
|
|
|
#push:
|
2021-01-14 17:25:21 +08:00
|
|
|
schedule:
|
2021-01-24 01:55:16 +08:00
|
|
|
- cron: 0 0 * * *
|
2021-01-14 17:25:21 +08:00
|
|
|
|
|
|
|
jobs:
|
2021-01-18 21:55:57 +08:00
|
|
|
test-linux:
|
2021-01-14 17:25:21 +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: [ ubuntu-18.04, ubuntu-20.04 ]
|
2021-01-14 17:25:21 +08:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
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
|
|
|
|
sudo apt-get install cabextract -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-24 01:55:16 +08:00
|
|
|
run: ./configure '--disable-shared' 'CXX=${{ matrix.compiler }}' 'CXXFLAGS=-g -O2 -fsanitize=address,undefined'
|
2021-01-18 01:13:56 +08:00
|
|
|
|
2021-01-20 01:40:20 +08:00
|
|
|
- name: Make and Install Tesseract and Training Tools
|
|
|
|
run: |
|
|
|
|
make training -j 8
|
|
|
|
sudo make install training-install
|
2021-01-14 17:25:21 +08:00
|
|
|
|
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 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-14 17:25:21 +08:00
|
|
|
|
2021-01-20 01:40:20 +08:00
|
|
|
- name: Run Tesseract on phototest.tif and devatest.png
|
|
|
|
run: |
|
|
|
|
tesseract test/testing/phototest.tif - --tessdata-dir ../tessdata
|
|
|
|
tesseract test/testing/devatest.png - -l hin+eng --tessdata-dir ../tessdata
|
|
|
|
|
|
|
|
- name: Make and run Unit Tests
|
|
|
|
run: |
|
|
|
|
make check -j 4
|
|
|
|
continue-on-error: true
|
2021-01-18 01:13:56 +08:00
|
|
|
|
2021-01-20 01:40:20 +08:00
|
|
|
- name: Display Unit Tests Report
|
|
|
|
run: |
|
|
|
|
git log -1
|
2021-01-20 13:10:38 +08:00
|
|
|
${{ matrix.compiler }} --version
|
2021-01-20 01:40:20 +08:00
|
|
|
cat unittest/test-suite.log
|
|
|
|
if: always()
|
|
|
|
|
|
|
|
test-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-20 13:10:38 +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-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-24 01:55:16 +08:00
|
|
|
brew install cabextract abseil
|
2021-01-20 01:40:20 +08:00
|
|
|
|
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-20 01:40:20 +08:00
|
|
|
- name: Make Tesseract and Training Tools
|
2021-01-18 01:13:56 +08:00
|
|
|
run: |
|
2021-01-20 01:40:20 +08:00
|
|
|
make training
|
2021-01-18 01:13:56 +08:00
|
|
|
|
2021-01-20 01:40:20 +08:00
|
|
|
- name: Install Tesseract and Training Tools
|
2021-01-18 01:13:56 +08:00
|
|
|
run: |
|
2021-01-20 01:40:20 +08:00
|
|
|
sudo make install
|
|
|
|
sudo make training-install
|
|
|
|
|
|
|
|
- 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
|
|
|
|
|
|
|
- name: Run Tesseract on phototest.tif and devatest.png
|
|
|
|
run: |
|
|
|
|
tesseract test/testing/phototest.tif - --tessdata-dir ../tessdata
|
|
|
|
tesseract test/testing/devatest.png - -l hin+eng --tessdata-dir ../tessdata
|
|
|
|
|
2021-01-18 21:55:57 +08:00
|
|
|
- name: Make and run Unit Tests
|
2021-01-20 01:40:20 +08:00
|
|
|
run: |
|
|
|
|
make check
|
|
|
|
continue-on-error: true
|
2021-01-18 01:13:56 +08:00
|
|
|
|
2021-01-18 21:55:57 +08:00
|
|
|
- name: Display Unit Tests Report
|
2021-01-20 01:40:20 +08:00
|
|
|
run: |
|
2021-01-20 13:10:38 +08:00
|
|
|
${{ matrix.compiler }} --version
|
2021-01-20 01:40:20 +08:00
|
|
|
git log -1
|
|
|
|
cat unittest/test-suite.log
|
|
|
|
if: always()
|
|
|
|
|
2021-01-24 01:55:16 +08:00
|
|
|
build-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
|
|
|
|
|
|
|
|
- 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-24 01:55:16 +08:00
|
|
|
sudo port install cabextract abseil
|
2021-01-20 01:40:20 +08:00
|
|
|
|
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-20 01:40:20 +08:00
|
|
|
- name: Make
|
2021-01-18 21:55:57 +08:00
|
|
|
run: |
|
2021-01-20 01:40:20 +08:00
|
|
|
make
|
2021-01-18 21:55:57 +08:00
|
|
|
|
2021-01-20 01:40:20 +08:00
|
|
|
- name: Make Training
|
2021-01-18 21:55:57 +08:00
|
|
|
run: |
|
2021-01-20 01:40:20 +08:00
|
|
|
make training
|
2021-01-18 21:55:57 +08:00
|
|
|
sudo make install training-install
|
2021-01-14 17:25:21 +08:00
|
|
|
|
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
|
|
|
- name: Run Tesseract on phototest.tif and devatest.png
|
|
|
|
run: |
|
|
|
|
tesseract test/testing/phototest.tif - --tessdata-dir ../tessdata
|
|
|
|
tesseract test/testing/devatest.png - -l hin+eng --tessdata-dir ../tessdata
|
|
|
|
|
2021-01-20 13:10:38 +08:00
|
|
|
# Unittests build on macports fails because of abseil LinkerInitialized related errors.
|
|
|
|
|
|
|
|
# - name: Make and run Unit Tests
|
|
|
|
# run: |
|
|
|
|
# make check
|
|
|
|
# continue-on-error: true
|
2021-01-18 21:55:57 +08:00
|
|
|
|
2021-01-20 13:10:38 +08:00
|
|
|
- name: Unit Tests Not Run
|
2021-01-20 01:40:20 +08:00
|
|
|
run: |
|
2021-01-20 13:10:38 +08:00
|
|
|
${{ matrix.compiler }} --version
|
2021-01-20 01:40:20 +08:00
|
|
|
git log -1
|
2021-01-20 13:10:38 +08:00
|
|
|
# cat unittest/test-suite.log
|
2021-01-20 01:40:20 +08:00
|
|
|
if: always()
|
|
|
|
|