Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/thirdparty/tesseract/.github/workflows/autotools-macos.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-macos | |
| 2 # autotools build of tesseract and training tools on macos homebrew and macports. | |
| 3 # run command line tests, basicapitest and unittests. '--disable-openmp' | |
| 4 on: | |
| 5 #push: | |
| 6 schedule: | |
| 7 - cron: 0 20 * * * | |
| 8 workflow_dispatch: | |
| 9 jobs: | |
| 10 | |
| 11 brew: | |
| 12 runs-on: ${{ matrix.config.os }} | |
| 13 strategy: | |
| 14 fail-fast: false | |
| 15 matrix: | |
| 16 config: | |
| 17 - { name: macos-latest-clang-autotools, os: macos-latest, cxx: clang++ } | |
| 18 | |
| 19 steps: | |
| 20 - uses: actions/checkout@v4 | |
| 21 with: | |
| 22 submodules: recursive | |
| 23 | |
| 24 - name: Get fonts, tessdata and langdata required for unit tests | |
| 25 run: | | |
| 26 git clone https://github.com/egorpugin/tessdata tessdata_unittest | |
| 27 cp tessdata_unittest/fonts/* test/testing/ | |
| 28 mv tessdata_unittest/* ../ | |
| 29 | |
| 30 - name: Install dependencies | |
| 31 run: | | |
| 32 brew install autoconf automake cabextract libtool | |
| 33 brew install curl icu4c leptonica libarchive pango | |
| 34 | |
| 35 - name: Setup Tesseract | |
| 36 run: | | |
| 37 ./autogen.sh | |
| 38 | |
| 39 - name: Configure Tesseract | |
| 40 run: | | |
| 41 ./configure '--disable-shared' '--disable-openmp' '--disable-doc' '--with-pic' 'CXX=${{ matrix.config.cxx }}' 'CXXFLAGS=-g -O2' | |
| 42 | |
| 43 - name: Make and Install Tesseract | |
| 44 run: | | |
| 45 make -j 8 | |
| 46 sudo make install install | |
| 47 - name: Make and Install Training Tools | |
| 48 run: | | |
| 49 make training -j 8 | |
| 50 sudo make install training-install | |
| 51 | |
| 52 - name: Make and run Unit Tests (clang) | |
| 53 if: startsWith(matrix.config.cxx, 'clang') | |
| 54 run: | | |
| 55 make check | |
| 56 | |
| 57 - name: Make and run Unit Tests (unset LANG needed for g++-8, g++-9, g++-10 on macOS) | |
| 58 if: startsWith(matrix.config.cxx, 'g') | |
| 59 shell: bash | |
| 60 run: | | |
| 61 unset LANG LC_ALL LC_CTYPE | |
| 62 locale | |
| 63 make check | |
| 64 | |
| 65 - name: Display Version for tesseract, lstmtraining, text2image | |
| 66 run: | | |
| 67 tesseract -v | |
| 68 lstmtraining -v | |
| 69 text2image -v | |
| 70 if: success() || failure() | |
| 71 | |
| 72 - name: List languages in different test tessdata-dir | |
| 73 run: | | |
| 74 tesseract --list-langs --tessdata-dir ../tessdata | |
| 75 tesseract --list-langs --tessdata-dir ../tessdata_best | |
| 76 tesseract --list-langs --tessdata-dir ../tessdata_fast | |
| 77 | |
| 78 - name: Run Tesseract on test images in different languages | |
| 79 run: | | |
| 80 tesseract test/testing/phototest.tif - --oem 1 --tessdata-dir ../tessdata | |
| 81 tesseract test/testing/raaj.tif - -l hin --oem 1 --tessdata-dir ../tessdata | |
| 82 tesseract test/testing/viet.tif - -l vie --oem 1 --tessdata-dir ../tessdata | |
| 83 tesseract test/testing/hebrew.png - -l heb --oem 1 --tessdata-dir ../tessdata | |
| 84 tesseract test/testing/eurotext.tif - -l fra --oem 1 --tessdata-dir ../tessdata_best | |
| 85 tesseract test/testing/arabic.tif - -l ara --oem 1 --psm 6 --tessdata-dir ../tessdata | |
| 86 | |
| 87 - name: Run Tesseract basicapitest | |
| 88 run: | | |
| 89 export "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" | |
| 90 cd test | |
| 91 ${{ matrix.config.cxx }} -o basicapitest testing/basicapitest.cpp $(pkg-config --cflags --libs tesseract lept) -pthread -std=c++17 -framework accelerate | |
| 92 ./basicapitest | |
| 93 | |
| 94 - name: Display Compiler Version | |
| 95 run: | | |
| 96 ${{ matrix.config.cxx }} --version | |
| 97 git log -3 --pretty=format:'%h %ad %s | %an' | |
| 98 if: always() | |
| 99 | |
| 100 - name: Display Unit Tests Report | |
| 101 run: | | |
| 102 cat test-suite.log | |
| 103 if: always() | |
| 104 | |
| 105 # ============================================================================================ | |
| 106 | |
| 107 ports: | |
| 108 runs-on: ${{ matrix.config.os }} | |
| 109 strategy: | |
| 110 fail-fast: false | |
| 111 matrix: | |
| 112 config: | |
| 113 - { name: macos-latest-clang-autotools, os: macos-latest, cxx: clang++ } | |
| 114 | |
| 115 steps: | |
| 116 - uses: actions/checkout@v4 | |
| 117 with: | |
| 118 submodules: recursive | |
| 119 | |
| 120 - name: Get fonts, tessdata and langdata required for tests | |
| 121 run: | | |
| 122 git clone https://github.com/egorpugin/tessdata tessdata_unittest | |
| 123 cp tessdata_unittest/fonts/* test/testing/ | |
| 124 mv tessdata_unittest/* ../ | |
| 125 | |
| 126 - name: Install Macports | |
| 127 run: | | |
| 128 curl -sSLO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci; source ./macports-ci install | |
| 129 # --remove-brew does not remove the Homebrew entries in bin, | |
| 130 # so remove them now. | |
| 131 rm -v $(brew --prefix)/bin/* | |
| 132 | |
| 133 - name: Install Dependencies | |
| 134 run: | | |
| 135 sudo port install autoconf automake libtool pkgconfig | |
| 136 sudo port install leptonica | |
| 137 sudo port install cairo pango | |
| 138 sudo port install icu +devel | |
| 139 sudo port install cabextract libarchive curl | |
| 140 | |
| 141 - name: Setup Tesseract | |
| 142 run: | | |
| 143 ./autogen.sh | |
| 144 | |
| 145 - name: Configure Tesseract | |
| 146 run: | | |
| 147 ./configure '--disable-shared' '--disable-openmp' '--disable-doc' '--with-pic' 'CXX=${{ matrix.config.cxx }}' 'CXXFLAGS=-g -O2' | |
| 148 | |
| 149 - name: Make and Install Tesseract | |
| 150 run: | | |
| 151 make -j 8 | |
| 152 sudo make install install | |
| 153 | |
| 154 - name: Make and Install Training Tools | |
| 155 run: | | |
| 156 make training -j 8 | |
| 157 sudo make install training-install | |
| 158 | |
| 159 - name: Make and run Unit Tests (clang) | |
| 160 if: startsWith(matrix.config.cxx, 'clang') | |
| 161 run: | | |
| 162 make check | |
| 163 | |
| 164 - name: Display Version for tesseract, lstmtraining, text2image | |
| 165 run: | | |
| 166 tesseract -v | |
| 167 lstmtraining -v | |
| 168 text2image -v | |
| 169 if: success() || failure() | |
| 170 | |
| 171 - name: List languages in different test tessdata-dir | |
| 172 run: | | |
| 173 tesseract --list-langs --tessdata-dir ../tessdata | |
| 174 tesseract --list-langs --tessdata-dir ../tessdata_best | |
| 175 tesseract --list-langs --tessdata-dir ../tessdata_fast | |
| 176 | |
| 177 - name: Run Tesseract on test images in different languages | |
| 178 run: | | |
| 179 tesseract test/testing/phototest.tif - --oem 1 --tessdata-dir ../tessdata | |
| 180 tesseract test/testing/raaj.tif - -l hin --oem 1 --tessdata-dir ../tessdata | |
| 181 tesseract test/testing/viet.tif - -l vie --oem 1 --tessdata-dir ../tessdata | |
| 182 tesseract test/testing/hebrew.png - -l heb --oem 1 --tessdata-dir ../tessdata | |
| 183 tesseract test/testing/eurotext.tif - -l fra --oem 1 --tessdata-dir ../tessdata_best | |
| 184 tesseract test/testing/arabic.tif - -l ara --oem 1 --psm 6 --tessdata-dir ../tessdata | |
| 185 | |
| 186 - name: Run Tesseract basicapitest | |
| 187 run: | | |
| 188 export "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" | |
| 189 cd test | |
| 190 ${{ matrix.config.cxx }} -o basicapitest testing/basicapitest.cpp -I/opt/local/include -L/opt/local/lib $(pkg-config --cflags --libs tesseract lept) -pthread -std=c++17 -framework Accelerate | |
| 191 ./basicapitest | |
| 192 | |
| 193 - name: Display Compiler Version | |
| 194 run: | | |
| 195 ${{ matrix.config.cxx }} --version | |
| 196 git log -3 --pretty=format:'%h %ad %s | %an' | |
| 197 if: always() | |
| 198 | |
| 199 - name: Display Unit Tests Report | |
| 200 run: | | |
| 201 cat test-suite.log | |
| 202 if: always() |
