-
Notifications
You must be signed in to change notification settings - Fork 6
88 lines (77 loc) · 2.89 KB
/
linux.yml
File metadata and controls
88 lines (77 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: linux
on: push
env:
TESSERACT_VERSION: 5.3.3
jobs:
build:
name: Build ${{ matrix.binary }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- binary: libtesseract64.so
steps:
- uses: actions/checkout@v4.1.7
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y g++-10 autoconf ninja-build
- name: Build Leptonica
run: |
echo "Building leptonica..."
git clone --depth 1 https://github.com/DanBloomberg/leptonica.git
cd leptonica
./autogen.sh
./configure '--with-pic' '--disable-shared' '--without-libpng' '--without-zlib' '--without-jpeg' '--without-libtiff' '--without-giflib' '--without-libwebp' '--without-libwebpmux' '--without-libopenjpeg' '--disable-programs' 'CXX=g++-10' 'CFLAGS=-D DEFAULT_SEVERITY=L_SEVERITY_ERROR -g0 -O3'
make
sudo make install
- name: Build Tesseract
run: |
echo "Building Tesseract..."
git clone --depth 1 --branch ${{ env.TESSERACT_VERSION }} https://github.com/tesseract-ocr/tesseract.git
cd tesseract
./autogen.sh
./configure '--with-pic' '--disable-shared' '--disable-legacy' '--disable-graphics' '--disable-openmp' '--without-curl' '--without-archive' '--disable-doc' 'CXX=g++-10' 'CXXFLAGS=-DTESS_EXPORTS -g0 -O3 -ffast-math'
make
sudo make install install
- name: Build Library
run: |
mkdir -p build
cmake -S . -B build -G Ninja
cmake --build build --config Release
- name: Print Library Dependencies
run: |
ldd build/${{ matrix.binary }}
- uses: actions/upload-artifact@v4.3.3
with:
name: ${{ matrix.binary }}
path: build/${{ matrix.binary }}
retention-days: 5
test:
name: Test ${{ matrix.binary }}
runs-on: ubuntu-22.04
needs: build
strategy:
fail-fast: false
matrix:
include:
- binary: libtesseract64.so
laz-url: https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.2.4/lazarus-project_2.2.4-0_amd64.deb
fpc-url: |
https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.2.4/fpc-laz_3.2.2-210709_amd64.deb
https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.2.4/fpc-src_3.2.2-210709_amd64.deb
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/download-artifact@v4
with:
name: ${{ matrix.binary }}
- name: Install Lazarus
uses: ollydev/setup-lazarus@v3.3
with:
laz-url: ${{ matrix.laz-url }}
fpc-url: ${{ matrix.fpc-url }}
- name: Test
run: |
lazbuild test/test.lpi
test/test ${{ matrix.binary }} ${{ env.TESSERACT_VERSION }}