2021-01-29 13:07:43 +08:00
|
|
|
name: unittest
|
2021-03-24 00:36:38 +08:00
|
|
|
# autotools build on ubuntu. unittests with address sanitizers. with openmp.
|
2021-02-15 22:04:29 +08:00
|
|
|
# [ FAILED ] LSTMTrainerTest.DeterminismTest - clang version 9.0.0-2~ubuntu18.04.2
|
2021-03-22 20:58:07 +08:00
|
|
|
# ubuntu-20.04-gcc-unittest - CI runs out of diskspace.
|
2021-01-29 13:07:43 +08:00
|
|
|
on:
|
|
|
|
#push:
|
|
|
|
schedule:
|
2021-03-24 00:36:38 +08:00
|
|
|
- cron: 0 0 * * *
|
2021-01-29 13:07:43 +08:00
|
|
|
|
|
|
|
jobs:
|
2021-02-15 22:04:29 +08:00
|
|
|
sanitizers:
|
2021-01-29 13:07:43 +08:00
|
|
|
name: ${{ matrix.config.name }}
|
|
|
|
runs-on: ${{ matrix.config.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
config:
|
2021-03-22 20:58:07 +08:00
|
|
|
- { name: ubuntu-18.04-gcc-unittest, os: ubuntu-18.04, cxx: g++ }
|
2021-03-24 00:36:38 +08:00
|
|
|
- { name: ubuntu-20.04-clang-unittest, os: ubuntu-20.04, cxx: clang++ }
|
2021-01-29 13:07:43 +08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
- name: Install dependencies (Linux)
|
|
|
|
run: |
|
2022-04-13 14:32:48 +08:00
|
|
|
sudo apt-get update
|
2021-05-16 13:45:12 +08:00
|
|
|
sudo apt-get install autoconf libleptonica-dev libpango1.0-dev -y
|
2021-01-29 13:07:43 +08:00
|
|
|
sudo apt-get install cabextract -y
|
2021-02-26 17:56:42 +08:00
|
|
|
|
2021-01-29 13:07:43 +08:00
|
|
|
- name: Setup
|
|
|
|
run: |
|
|
|
|
mkdir -p m4
|
|
|
|
./autogen.sh
|
|
|
|
|
|
|
|
- name: Configure (Linux)
|
|
|
|
run: |
|
2021-03-24 00:36:38 +08:00
|
|
|
./configure '--disable-shared' 'CXX=${{ matrix.config.cxx }}' \
|
|
|
|
'CXXFLAGS=-g -O2 -fsanitize=address,undefined'
|
2021-01-29 13:07:43 +08:00
|
|
|
|
|
|
|
- name: Make and Install Tesseract
|
|
|
|
run: |
|
2021-03-24 00:36:38 +08:00
|
|
|
${{ matrix.config.cxx }} --version
|
|
|
|
make
|
2021-01-29 13:07:43 +08:00
|
|
|
sudo make install
|
|
|
|
|
|
|
|
- name: Make and Install Training Tools
|
|
|
|
run: |
|
2021-03-24 00:36:38 +08:00
|
|
|
make training
|
2021-01-29 13:07:43 +08:00
|
|
|
sudo make training-install
|
2021-02-26 17:56:42 +08:00
|
|
|
|
2021-03-24 00:36:38 +08:00
|
|
|
- name: Display Tesseract and Training Tools Version
|
2021-01-29 13:07:43 +08:00
|
|
|
run: |
|
|
|
|
tesseract -v
|
|
|
|
lstmtraining -v
|
|
|
|
text2image -v
|
|
|
|
if: success() || failure()
|
2021-02-26 17:56:42 +08:00
|
|
|
|
2021-01-29 13:07:43 +08:00
|
|
|
- name: Download fonts, tessdata and langdata required for tests
|
|
|
|
run: |
|
|
|
|
git clone https://github.com/egorpugin/tessdata tessdata_unittest
|
2021-02-26 17:56:42 +08:00
|
|
|
cp tessdata_unittest/fonts/* test/testing/
|
2021-01-29 13:07:43 +08:00
|
|
|
mv tessdata_unittest/* ../
|
2021-02-26 17:56:42 +08:00
|
|
|
|
2021-01-29 13:07:43 +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: |
|
2021-03-24 00:36:38 +08:00
|
|
|
make check
|
2021-02-26 17:56:42 +08:00
|
|
|
|
2021-03-24 00:36:38 +08:00
|
|
|
- name: Display Unit Tests Report and Compiler Version
|
2021-01-29 13:07:43 +08:00
|
|
|
run: |
|
|
|
|
cat test-suite.log
|
|
|
|
${{ matrix.config.cxx }} --version
|
2021-02-26 17:56:42 +08:00
|
|
|
git log -3 --pretty=format:'%h %ad %s | %an'
|
2021-01-29 13:07:43 +08:00
|
|
|
if: always()
|