2021-03-24 00:36:38 +08:00
|
|
|
name: unittest-macos
|
|
|
|
# autotools build on homebrew. unittests with address sanitizers. with openmp.
|
|
|
|
on:
|
|
|
|
#push:
|
|
|
|
schedule:
|
|
|
|
- cron: 0 0 * * *
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
sanitizers:
|
|
|
|
name: ${{ matrix.config.name }}
|
|
|
|
runs-on: ${{ matrix.config.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
config:
|
2024-03-08 12:47:03 +08:00
|
|
|
- { name: macos-arm-14-clang-unittest, os: macos-14, cxx: clang++ } # Apple silicon
|
2024-10-17 04:49:58 +08:00
|
|
|
- { name: macos-latest-clang-unittest, os: macos-latest, cxx: clang++ }
|
|
|
|
- { name: macos-latest-gcc-unittest, os: macos-latest, cxx: g++ }
|
2021-03-24 00:36:38 +08:00
|
|
|
|
|
|
|
steps:
|
2024-03-04 05:02:01 +08:00
|
|
|
- uses: actions/checkout@v4
|
2021-03-24 00:36:38 +08:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
2022-12-14 00:37:18 +08:00
|
|
|
- name: Install dependencies (macOS Homebrew)
|
2021-03-24 00:36:38 +08:00
|
|
|
run: |
|
2024-07-29 23:20:20 +08:00
|
|
|
brew install autoconf automake cabextract libtool
|
2024-10-22 22:41:29 +08:00
|
|
|
brew install curl icu4c leptonica libarchive pango
|
2021-03-24 00:36:38 +08:00
|
|
|
- name: Setup
|
|
|
|
run: |
|
|
|
|
./autogen.sh
|
|
|
|
|
2022-12-14 00:37:18 +08:00
|
|
|
- name: Configure (macOS Homebrew)
|
2021-03-24 00:36:38 +08:00
|
|
|
run: |
|
|
|
|
./configure '--disable-shared' '--with-pic' \
|
|
|
|
'CXX=${{ matrix.config.cxx }}' \
|
2022-01-13 02:21:53 +08:00
|
|
|
'CXXFLAGS=-g -O2 -fsanitize=address,undefined'
|
2021-03-24 00:36:38 +08:00
|
|
|
|
|
|
|
- name: Make and Install Tesseract
|
|
|
|
run: |
|
|
|
|
make
|
|
|
|
sudo make install
|
|
|
|
|
|
|
|
- name: Make and Install Training Tools
|
|
|
|
run: |
|
|
|
|
make training
|
|
|
|
sudo make training-install
|
|
|
|
|
|
|
|
- name: Display Tesseract and Training Tools Version
|
|
|
|
run: |
|
|
|
|
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
|
|
|
|
|
|
|
|
- name: Display Unit Tests Report and compiler version
|
|
|
|
run: |
|
|
|
|
cat test-suite.log
|
|
|
|
${{ matrix.config.cxx }} --version
|
|
|
|
git log -3 --pretty=format:'%h %ad %s | %an'
|
|
|
|
if: always()
|