From 9985afbf7f52ee8eb5ca3145510f81a3b4224e8c Mon Sep 17 00:00:00 2001 From: istoki0bespokoystva Date: Wed, 23 Jul 2025 15:38:59 +0300 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 53 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..b1f2cd3 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,53 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: # Для ручного запуска + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install Tesseract + run: | + sudo apt-get update + sudo apt-get install -y tesseract-ocr tesseract-ocr-rus + + - name: Install Poppler + run: | + sudo apt-get install -y poppler-utils + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Create dummy credentials file + run: | + echo "{}" > credentials.json + + - name: Create test PDF fixture + run: | + mkdir -p tests/fixtures + echo "Creating dummy PDF for testing" + # Убедитесь, что у вас есть скрипт для создания PDF или добавьте существующий PDF + # Пример: скопируйте тестовый PDF, если он есть в репозитории + # cp tests/fixtures/test_report.pdf tests/fixtures/report.pdf || true + + - name: Run tests + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + pytest tests/ -v --log-cli-level=DEBUG