From c224f4933ba0aeacd967509d80fa0ce31ed56a56 Mon Sep 17 00:00:00 2001 From: pjmalandrino Date: Fri, 20 Mar 2026 16:32:52 +0100 Subject: [PATCH] Add CI --- .github/workflows/ci.yml | 66 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..76d08ba --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,66 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +# Cancel previous runs on the same branch/PR +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + backend: + name: Backend tests + runs-on: ubuntu-latest + defaults: + run: + working-directory: document-parser + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + cache-dependency-path: document-parser/requirements.txt + + - name: Install system dependencies + run: sudo apt-get update && sudo apt-get install -y --no-install-recommends poppler-utils + + - name: Install Python dependencies + run: | + pip install --upgrade pip + pip install -r requirements.txt + pip install pytest pytest-asyncio httpx + + - name: Run tests + run: pytest tests/ -v + + frontend: + name: Frontend tests & build + runs-on: ubuntu-latest + defaults: + run: + working-directory: frontend + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: frontend/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm run test:run + + - name: Build + run: npm run build