Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/thirdparty/tesseract/.github/workflows/autotools.yml @ 2:b50eed0cc0ef upstream
ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4.
The directory name has changed: no version number in the expanded directory now.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:43:07 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 1:1d09e1dec1d9 | 2:b50eed0cc0ef |
|---|---|
| 1 name: autotools | |
| 2 # autotools build of tesseract and training tools on Ubuntu. | |
| 3 # run command line tests, basicapitest and unittests. '--disable-openmp' | |
| 4 on: | |
| 5 #push: | |
| 6 schedule: | |
| 7 - cron: 0 20 * * * | |
| 8 jobs: | |
| 9 | |
| 10 linux: | |
| 11 runs-on: ${{ matrix.config.os }} | |
| 12 strategy: | |
| 13 fail-fast: false | |
| 14 matrix: | |
| 15 config: | |
| 16 - { name: ubuntu-22.04-clang-15-autotools, os: ubuntu-22.04, cxx: clang++-15 } #installed | |
| 17 | |
| 18 - { name: ubuntu-22.04-gcc-12-autotools, os: ubuntu-22.04, cxx: g++-12 } #installed | |
| 19 - { name: ubuntu-22.04-gcc-11-autotools, os: ubuntu-22.04, cxx: g++-11 } #installed | |
| 20 - { name: ubuntu-20.04-gcc-10-autotools, os: ubuntu-20.04, cxx: g++-10 } #installed | |
| 21 - { name: ubuntu-20.04-gcc-9-autotools, os: ubuntu-20.04, cxx: g++-9 } #installed | |
| 22 | |
| 23 steps: | |
| 24 - uses: actions/checkout@v4 | |
| 25 with: | |
| 26 submodules: recursive | |
| 27 | |
| 28 - name: Download fonts, tessdata and langdata required for tests | |
| 29 run: | | |
| 30 git clone https://github.com/egorpugin/tessdata tessdata_unittest | |
| 31 cp tessdata_unittest/fonts/* test/testing/ | |
| 32 mv tessdata_unittest/* ../ | |
| 33 | |
| 34 - name: Install Compiler | |
| 35 run: | | |
| 36 sudo apt-get update | |
| 37 sudo apt-get install -y ${{ matrix.config.cxx }} | |
| 38 | |
| 39 - name: Install dependencies | |
| 40 run: | | |
| 41 sudo apt-get install autoconf libleptonica-dev -y | |
| 42 sudo apt-get install libpango1.0-dev -y | |
| 43 sudo apt-get install cabextract libarchive-dev -y | |
| 44 sudo apt-get install libcurl4-openssl-dev libcurl4 curl -y | |
| 45 | |
| 46 - name: Setup Tesseract | |
| 47 run: | | |
| 48 ./autogen.sh | |
| 49 | |
| 50 - name: Configure Tesseract | |
| 51 run: | | |
| 52 ./configure '--disable-shared' '--disable-openmp' '--disable-doc' 'CXX=${{ matrix.config.cxx }}' 'CXXFLAGS=-g -O2' | |
| 53 | |
| 54 - name: Make and Install Tesseract | |
| 55 run: | | |
| 56 make -j 8 | |
| 57 sudo make install install | |
| 58 | |
| 59 - name: Make and Install Training Tools | |
| 60 run: | | |
| 61 make training -j 8 | |
| 62 sudo make install training-install | |
| 63 | |
| 64 - name: Make and run Unit Tests | |
| 65 run: | | |
| 66 make check | |
| 67 | |
| 68 - name: Display Version for tesseract, lstmtraining, text2image | |
| 69 run: | | |
| 70 tesseract -v | |
| 71 lstmtraining -v | |
| 72 text2image -v | |
| 73 if: success() || failure() | |
| 74 | |
| 75 - name: List languages in different test tessdata-dir | |
| 76 run: | | |
| 77 tesseract --list-langs --tessdata-dir ../tessdata | |
| 78 tesseract --list-langs --tessdata-dir ../tessdata_best | |
| 79 tesseract --list-langs --tessdata-dir ../tessdata_fast | |
| 80 | |
| 81 - name: Run Tesseract on test images in different languages | |
| 82 run: | | |
| 83 tesseract test/testing/phototest.tif - --oem 1 --tessdata-dir ../tessdata | |
| 84 tesseract test/testing/raaj.tif - -l hin --oem 1 --tessdata-dir ../tessdata | |
| 85 tesseract test/testing/viet.tif - -l vie --oem 1 --tessdata-dir ../tessdata | |
| 86 tesseract test/testing/hebrew.png - -l heb --oem 1 --tessdata-dir ../tessdata | |
| 87 tesseract test/testing/eurotext.tif - -l fra --oem 1 --tessdata-dir ../tessdata_best | |
| 88 tesseract test/testing/arabic.tif - -l ara --oem 1 --psm 6 --tessdata-dir ../tessdata | |
| 89 | |
| 90 - name: Run Tesseract basicapitest | |
| 91 run: | | |
| 92 export "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" | |
| 93 cd test | |
| 94 ${{ matrix.config.cxx }} -o basicapitest testing/basicapitest.cpp -I/usr/local/include -L/usr/local/lib `pkg-config --cflags --libs tesseract lept ` -pthread -std=c++17 | |
| 95 ./basicapitest | |
| 96 | |
| 97 - name: Setup for Tesseract benchmark using image from issue 263 fifteen times in a list file | |
| 98 run: | | |
| 99 wget -O i263_speed.jpg https://cloud.githubusercontent.com/assets/9968625/13674495/ac261db4-e6ab-11e5-9b4a-ad91d5b4ff87.jpg | |
| 100 printf 'i263_speed.jpg\n%.0s' {1..15} > benchmarks.list | |
| 101 lscpu | |
| 102 free | |
| 103 tesseract -v | |
| 104 | |
| 105 - name: Run Tesseract using image from issue 263 with tessdata_fast | |
| 106 run: | | |
| 107 time tesseract benchmarks.list - --tessdata-dir ../tessdata_fast > /dev/null 2>&1 | |
| 108 echo "tessdata_fast - disable-openmp" | |
| 109 | |
| 110 - name: Run Tesseract using image from issue 263 with tessdata_best | |
| 111 run: | | |
| 112 time tesseract benchmarks.list - --tessdata-dir ../tessdata_best > /dev/null 2>&1 | |
| 113 echo "tessdata_best - disable-openmp" | |
| 114 | |
| 115 - name: Run Tesseract using image from issue 263 with tessdata_fast | |
| 116 run: | | |
| 117 time tesseract benchmarks.list - --tessdata-dir ../tessdata > /dev/null 2>&1 | |
| 118 echo "tessdata - disable-openmp" | |
| 119 | |
| 120 - name: Display Compiler Version | |
| 121 run: | | |
| 122 ${{ matrix.config.cxx }} --version | |
| 123 git log -3 --pretty=format:'%h %ad %s | %an' | |
| 124 if: always() | |
| 125 | |
| 126 - name: Display Unit Tests Report | |
| 127 run: | | |
| 128 cat test-suite.log | |
| 129 if: always() |
