-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (97 loc) · 3.56 KB
/
buiild-and-test.yml
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
89
90
91
92
93
94
95
96
97
98
name: Build and test
env:
TES_REMOVE_NEWLINES: '0'
on:
push:
pull_request:
branches: [ "main" ]
jobs:
build-on-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
args: --timeout 120s --max-same-issues 10
continue-on-error: true
- name: Build service
run: go build -tags nomsgpack
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -q -y ca-certificates wv curl libpoppler-glib8
- name: Install libpdfium
run: curl -sS --location https://github.com/bblanchon/pdfium-binaries/releases/latest/download/pdfium-linux-x64.tgz | sudo tar -xz -C /usr lib/libpdfium.so
- name: Run basic test
env:
TES_PDF_LIB_NAME: poppler
run: time ./text-extraction-service pkg/pdflibwrappers/testdata/2000001.pdf
- name: Run basic test
run: time ./text-extraction-service pkg/pdflibwrappers/testdata/2000001.pdf
build-embedded-on-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Download libpdfium
run: pkg/pdflibwrappers/pdfium_purego/download-pdfium.sh
- name: Build service
run: go build -tags nomsgpack,embed_pdfium
- name: Run basic test - embedded pdfium
run: time ./text-extraction-service pkg/pdflibwrappers/testdata/2000001.pdf
build-embedded-on-darwin:
runs-on: "macos-latest"
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Download libpdfium
run: pkg/pdflibwrappers/pdfium_purego/download-pdfium.sh
- name: Build service
run: go build -tags nomsgpack,embed_pdfium
- name: Run basic test
run: time ./text-extraction-service pkg/pdflibwrappers/testdata/2000001.pdf
- name: Install Poppler
run: brew install poppler
- name: Run with Poppler
env:
TES_PDF_LIB_NAME: poppler
run: time ./text-extraction-service pkg/pdflibwrappers/testdata/2000001.pdf
build-embedded-on-alpine:
runs-on: "ubuntu-latest"
container: alpine:3.21
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Install some tools
run: apk update && apk add --no-cache file binutils
- name: Download libpdfium
run: pkg/pdflibwrappers/pdfium_purego/download-pdfium.sh
- name: Build service
run: go build -tags nomsgpack,embed_pdfium
- name: Run basic test - PDFium
run: time ./text-extraction-service pkg/pdflibwrappers/testdata/2000001.pdf
- name: Install MuPDF and Poppler
run: apk add --no-cache mupdf-libs poppler-glib wv icu-libs && ln -s /usr/lib/libmupdf.so* /usr/lib/libmupdf.so
- name: Run basic test - Poppler
env:
TES_PDF_LIB_NAME: poppler
run: time ./text-extraction-service pkg/pdflibwrappers/testdata/2000001.pdf
- name: Run basic test - MuPDF
env:
TES_PDF_LIB_NAME: mupdf
MUPDF_VERSION: "1.24.10"
run: time ./text-extraction-service pkg/pdflibwrappers/testdata/2000001.pdf