-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (63 loc) · 3.66 KB
/
run_tests.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
name: Run tests
on:
push:
branches: [ devel, master ]
pull_request:
branches: [ devel, master ]
release:
types: [published]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
working-directory: ./
strategy:
matrix:
python-version: ["3.11"]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: checkout repo
uses: actions/checkout@v2
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y python3-dev python3-pip python3.11 python3.11-dev python3.11-venv python3.11-doc
sudo echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections
sudo apt-get install -y --no-install-recommends fontconfig ttf-mscorefonts-installer
sudo fc-cache -f -v
sudo apt-get install -y libimage-exiftool-perl libtcnative-1 && \
sudo apt-get install -y ttf-mscorefonts-installer fontconfig && \
sudo apt-get install -y --fix-missing libsm6 libxext6 gstreamer1.0-libav fonts-deva fonts-dejavu fonts-gfs-didot fonts-gfs-didot-classic fonts-junicode fonts-ebgaramond fonts-noto-cjk fonts-takao-gothic fonts-vlgothic && \
sudo apt-get install -y --fix-missing ghostscript ghostscript-x gsfonts gsfonts-other gsfonts-x11 fonts-croscore fonts-crosextra-caladea fonts-crosextra-carlito fonts-liberation fonts-open-sans fonts-noto-core fonts-ibm-plex fonts-urw-base35 && \
sudo apt-get install -y --fix-missing imagemagick libcairo2-dev tesseract-ocr tesseract-ocr-eng tesseract-ocr-osd tesseract-ocr-lat tesseract-ocr-fra tesseract-ocr-deu libleptonica-dev liblept5 && \
sudo apt-get install -y --fix-missing libpcre3 libpcre3-dev && \
sudo apt-get install -y --fix-missing mesa-opencl-icd pocl-opencl-icd && \
sudo apt-get install -y --fix-missing libvips-tools libvips libvips-dev
sudo apt-get install -y python3-tk tcl8.6-dev tk8.6-dev libopenjp2-7-dev libharfbuzz-dev libfribidi-dev libxcb1-dev libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev
# python3 poppler requirement
sudo apt-get install poppler-utils -y
sudo apt-get install -y --no-install-recommends default-jre libreoffice-java-common libreoffice libreoffice-script-provider-python
sudo apt-get install -y isort flake8
sudo -H python3.11 -m pip install --upgrade pip --break-system-packages
sudo -H python3.11 -m pip install setuptools numpy matplotlib --break-system-packages
sudo -H python3.11 -m pip install wheel virtualenv cython uwsgi --break-system-packages
sudo -H python3.11 -m pip install opencv-python-headless --break-system-packages
sudo -H python3.11 -m pip install --upgrade pip
sudo -H python3.11 -m pip install setuptools
sudo -H python3.11 -m pip install unoserver
sudo -H python3.11 -m pip install --no-cache-dir -r ./requirements.txt
# - name: Check linting and types
# run: |
# isort .
# flake8 .
# mypy . --ignore-missing-imports
- name: Run tests
run: /usr/bin/python3 -m unittest ocr_service/tests/process.py