-
Notifications
You must be signed in to change notification settings - Fork 722
65 lines (54 loc) · 1.94 KB
/
ci.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
name: CI
on:
push:
branches:
- master
- '*.x'
pull_request:
branches:
- master
- '*.x'
jobs:
tests:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- {name: '3.10', python: '3.10', os: ubuntu-20.04, tox: py310}
- {name: '3.9', python: '3.9', os: ubuntu-20.04, tox: py39}
- {name: '3.8', python: '3.8', os: ubuntu-20.04, tox: py38}
- {name: '3.7', python: '3.7', os: ubuntu-20.04, tox: py37}
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Upgrade bootstrap packages
run: python -m pip install --upgrade pip tox
- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('setup.py') }}
restore-keys: pip-${{ runner.os }}-${{ matrix.python }}-
- name: Set Python version
# See https://pre-commit.com/#github-actions-example
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- name: Install tesseract
run: sudo apt-get -y update && sudo apt-get install -y tesseract-ocr tesseract-ocr-fra
- name: Print tesseract version
run: echo $(tesseract --version)
- name: Run tox
run: tox -e ${{ matrix.tox }}
env:
PY_COLORS: 1
TOX_TESTENV_PASSENV: PY_COLORS
- name: Test pytesseract package installation
run: pip install -U git+${{ github.server_url }}/${{ github.repository }} && pip show pytesseract && python -c 'import pytesseract'