tesseract/.github/workflows/unittest-sanitizer.yml
2021-01-24 11:56:15 +00:00

145 lines
4.0 KiB
YAML

name: unittest
on:
#push:
schedule:
- cron: 0 22 * * *
jobs:
linux:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
compiler: [ g++, clang++ ]
os: [ ubuntu-18.04, ubuntu-20.04 ]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get install autoconf-archive libleptonica-dev libpango1.0-dev -y
sudo apt-get install cabextract -y
- name: Setup
run: |
mkdir -p m4
./autogen.sh
- name: Configure
run: ./configure '--disable-shared' 'CXX=${{ matrix.compiler }}' 'CXXFLAGS=-g -O2 -fsanitize=address,undefined'
- name: Make and Install Tesseract
run: |
make -j 8
sudo make install install
- name: Make and Install Training Tools
run: |
make training -j 8
sudo make install training-install
- name: Display Version
run: |
${{ matrix.compiler }} --version
tesseract -v
lstmtraining -v
text2image -v
if: success() || failure()
- name: Download fonts, tessdata and langdata required for tests
run: |
git clone https://github.com/egorpugin/tessdata tessdata_unittest
cp tessdata_unittest/fonts/* test/testing/
mv tessdata_unittest/* ../
- 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
- name: Display Unit Tests Report
run: |
git log -1
${{ matrix.compiler }} --version
cat unittest/test-suite.log
if: always()
macos-brew:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
compiler: [ g++, clang++ ]
os: [ macos-10.15 ]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: install dependencies
run: |
brew install automake autoconf-archive
brew install libarchive
brew install leptonica
brew install cairo pango
brew install cabextract abseil
- name: Setup
run: |
mkdir -p m4
./autogen.sh
- name: Configure
run: |
./configure '--disable-shared' '--with-pic' 'CXX=${{ matrix.compiler }}' 'CXXFLAGS=-g -O2 -fsanitize=address,undefined' 'PKG_CONFIG_PATH=/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/libarchive/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig'
- name: Make and Install Tesseract
run: |
make -j 8
sudo make install install
- name: Make and Install Training Tools
run: |
make training -j 8
sudo make install training-install
- name: Display Version
run: |
${{ matrix.compiler }} --version
tesseract -v
lstmtraining -v
text2image -v
if: success() || failure()
- 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/* ../
- 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
- name: Display Unit Tests Report
run: |
${{ matrix.compiler }} --version
git log -1
cat unittest/test-suite.log
if: always()