-
Notifications
You must be signed in to change notification settings - Fork 88
101 lines (93 loc) · 2.98 KB
/
coverage.yaml
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
99
100
101
name: "coverage.io"
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
pytest:
name: Run pytests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-12, windows-2022, ubuntu-22.04]
steps:
# SETUP ENVIRONMENT
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry==1.4.2
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"
- name: Prepare Linux
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install \
python3-pil \
tesseract-ocr \
tesseract-ocr-eng \
tesseract-ocr-jpn \
tesseract-ocr-chi-sim
sudo apt-get install \
xvfb \
libxkbcommon-x11-0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-xinerama0 \
libxcb-xfixes0 \
libxcb-shape0 \
libxcb-cursor0 \
libegl1 \
libegl1-mesa
sudo apt-get install \
ca-certificates
echo "XDG_SESSION_TYPE=gnome" >> $GITHUB_ENV
- name: Prepare macOS
if: matrix.os == 'macos-12'
run: |
brew install pkg-config tesseract tesseract-lang dylibbundler
brew info tesseract
"/Library/Application Support/VMware Tools/vmware-resolutionSet" 1920 1080
- name: Prepare Windows
if: matrix.os == 'windows-2022'
run: |
$url = "https://digi.bib.uni-mannheim.de/tesseract/tesseract-ocr-w64-setup-v5.0.1.20220118.exe"
Invoke-WebRequest -Uri $url -OutFile "tesseract_installer.exe"
7z x tesseract_installer.exe -O"C:\Program Files\Tesseract-OCR"
$tesseract = "C:\Program Files\Tesseract-OCR\"
echo "$tesseract" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "TESSDATA_PREFIX=$tesseract" >> $env:GITHUB_ENV
Set-DisplayResolution -Width 1920 -Height 1080 -Force
- name: Test tesseract
run: |
tesseract --version
tesseract --list-langs
- name: Poetry install
run: poetry install
# PERFORM TESTS
- name: Pytest
run: |
poetry run pytest -vv -m "not skip_on_gh" --cov --cov-report=xml
poetry run coverage lcov
- name: Coveralls Parallel
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: ${{ matrix.os }}
path-to-lcov: coverage.lcov
parallel: true
coveralls-upload:
needs: pytest
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true