Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Commit

Permalink
ci(schedule-run): add tesseract and dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinNitroG committed Jan 12, 2025
1 parent 26e509d commit fc9b118
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .github/workflows/schedule-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
workflow_dispatch:
# user-config end

env:
TESSERACT_DATASET_URL: 'https://github.com/tesseract-ocr/tessdata/raw/refs/heads/main/eng.traineddata'

jobs:
run:
name: Run
Expand All @@ -32,6 +35,23 @@ jobs:
- uses: extractions/setup-just@v2

- name: Get required apt packages
id: get-pkgs
shell: bash
run: echo "pkgs=$( tr '\n' ' ' <'./apt_pkgs.txt' )" > "$GITHUB_OUTPUT"

- uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: ${{ steps.get-pkgs.outputs.pkgs }}
version: ${{ hashFiles('apt_pkgs.txt') }}
execute_install_scripts: true

- name: Download tesseract dataset
run: |
sudo mkdir -p /usr/share/tessdata
cd /usr/share/tessdata
curl -O ${{ env.TESSERACT_DATASET_URL }}
- name: Install production deps
run: uv sync --no-dev

Expand Down
1 change: 1 addition & 0 deletions apt_pkgs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tesseract-ocr
2 changes: 1 addition & 1 deletion docs/usage/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Yêu cầu

- [Python](https://www.python.org/downloads/)
- [Tesseact OCR CLI](https://tesseract-ocr.github.io/tessdoc/Installation.html) (Không bắt buộc)(1)
- [Tesseact OCR CLI](https://tesseract-ocr.github.io/tessdoc/Installation.html) [Tesseact data set](https://github.com/tesseract-ocr/tessdata) (Không bắt buộc)(1)
{ .annotate }

1. Sử dụng để giải captcha đối với API csgt.vn
Expand Down

0 comments on commit fc9b118

Please sign in to comment.