2024-07-09 19:28:27 +03:00
|
|
|
name: Run Tests with Tika Server
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths:
|
|
|
|
- 'backend/core/**'
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'backend/core/**'
|
2024-07-09 19:39:01 +03:00
|
|
|
workflow_dispatch:
|
2024-07-09 19:28:27 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
services:
|
|
|
|
tika:
|
|
|
|
image: apache/tika
|
|
|
|
ports:
|
|
|
|
- 9998:9998
|
|
|
|
options: >-
|
2024-07-09 19:43:32 +03:00
|
|
|
--health-cmd="curl --fail http://localhost:9998/tika --max-time 5 || exit 1"
|
2024-07-09 19:39:01 +03:00
|
|
|
--health-interval=30s
|
|
|
|
--health-timeout=10s
|
|
|
|
--health-retries=10
|
2024-07-09 19:28:27 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: '3.11'
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
cd backend/core
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install poetry
|
|
|
|
poetry install -E base
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
env:
|
|
|
|
TIKA_URL: http://localhost:9998/tika
|
|
|
|
run: |
|
|
|
|
cd backend/core
|
|
|
|
poetry run pytest tests
|