55 branches : [main, master]
66 tags : ' *'
77 pull_request :
8+ workflow_call :
9+ inputs :
10+ os :
11+ required : false
12+ type : string
13+ default : ubuntu-latest
14+ env :
15+ required : true
16+ type : string
17+ default : ' ["py39", "py310", "py311", "py312", "py313"]'
18+ arch :
19+ required : false
20+ type : string
21+ default : ' [""]'
22+ wheel-tags :
23+ required : false
24+ type : boolean
25+ default : false
26+ submodules :
27+ required : false
28+ type : boolean
29+ default : false
30+
31+ concurrency :
32+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
33+ cancel-in-progress : true
834
935jobs :
10- tests :
11- if : " !contains(github.event.head_commit.message, '[skip ci]')"
12- name : ${{ matrix.name }}
13- runs-on : ${{ matrix.os }}
36+ tox :
37+ name : ${{ inputs.os }} / ${{ matrix.env }}${{ inputs.arch != '[""]' && format(' / {0}', matrix.arch) || '' }}
38+ runs-on : ${{ inputs.os }}
1439 strategy :
15- fail-fast : true
1640 matrix :
17- include :
18- - {name: '3.12', python: '3.12', os: ubuntu-latest, tox: py312}
19- - {name: '3.11', python: '3.11', os: ubuntu-latest, tox: py311}
20- - {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310}
21- - {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39}
22- - {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}
41+ env : ${{ fromJSON(inputs.env) }}
42+ arch : ${{ fromJSON(inputs.arch) }}
2343 steps :
24- - uses : actions/checkout@v4
25-
26- - name : Setup Python
27- uses : actions/setup-python@v5
28- with :
29- python-version : ${{ matrix.python }}
30- cache : ' pip'
31-
32- - name : Upgrade bootstrap packages
33- run : python -m pip install --upgrade pip tox
44+ - name : Install tesseract
45+ run : sudo apt-get -y update && sudo apt-get install -y tesseract-ocr tesseract-ocr-fra
3446
35- - name : Install tesseract
36- run : sudo apt-get -y update && sudo apt-get install -y tesseract-ocr tesseract-ocr-fra
47+ - name : Print tesseract version
48+ run : echo $( tesseract --version)
3749
38- - name : Print tesseract version
39- run : echo $(tesseract --version)
50+ -
uses :
asottile/workflows/.github/actions/[email protected] 51+ with :
52+ submodules : ${{ inputs.submodules }}
4053
41- - name : Run tox
42- run : tox -e ${{ matrix.tox }}
43- env :
44- PY_COLORS : 1
45- TOX_TESTENV_PASSENV : PY_COLORS
54+ - uses : actions/setup-python@v5
55+ with :
56+ python-version : |
57+ ${{
58+ (matrix.env == 'py39' || startsWith(matrix.env, 'py39-')) && '3.9' ||
59+ (matrix.env == 'py310' || startsWith(matrix.env, 'py310-')) && '3.10' ||
60+ (matrix.env == 'py311' || startsWith(matrix.env, 'py311-')) && '3.11' ||
61+ (matrix.env == 'py312' || startsWith(matrix.env, 'py312-')) && '3.12' ||
62+ (matrix.env == 'py313' || startsWith(matrix.env, 'py313-')) && '3.13'
63+ }}
64+ cache : ' pip'
65+ architecture : ${{ matrix.arch }}
4666
47- - name : Test pytesseract package installation
48- run : pip install -U . && pip show pytesseract && python -c 'import pytesseract'
67+ - name : Test pytesseract package installation
68+ run : pip install -U . && pip show pytesseract && python -c 'import pytesseract'
0 commit comments