Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Build and Push

on:
push:
branches: [main]
workflow_call:
workflow_dispatch:

jobs:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/front-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Front unit tests

on:
pull_request:
workflow_call:

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: front

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
cache-dependency-path: front/package-lock.json

- name: Install dependencies
run: npm ci --legacy-peer-deps

- name: Run unit tests
run: npm test
18 changes: 18 additions & 0 deletions .github/workflows/main-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Main pipeline (test then build)

on:
push:
branches: [main]
workflow_dispatch:

jobs:
front-tests:
uses: ./.github/workflows/front-test.yml

server-tests:
uses: ./.github/workflows/server-test.yml

build-and-push:
needs: [front-tests, server-tests]
uses: ./.github/workflows/build-all.yml
secrets: inherit
73 changes: 73 additions & 0 deletions .github/workflows/server-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Server tests

on:
pull_request:
workflow_call:
inputs:
run_integration:
description: "Also run pytest -m integration"
type: boolean
default: false
workflow_dispatch:
inputs:
run_integration:
description: "Also run pytest -m integration"
type: boolean
default: false
schedule:
# Weekly Monday 06:00 UTC — integration suite (mongomock, no Docker services)
- cron: "0 6 * * 1"

jobs:
unit:
runs-on: ubuntu-latest
defaults:
run:
working-directory: server

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip
cache-dependency-path: server/requirements-dev.txt

- name: Install dependencies
run: pip install -r requirements-dev.txt

- name: Run unit tests with coverage
run: |
coverage run -m pytest -m unit -q
coverage report -m

integration:
# schedule: always run integration weekly.
# workflow_dispatch / workflow_call: only when run_integration is true.
if: >
github.event_name == 'schedule' ||
((github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.run_integration)
runs-on: ubuntu-latest
defaults:
run:
working-directory: server

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip
cache-dependency-path: server/requirements-dev.txt

- name: Install dependencies
run: pip install -r requirements-dev.txt

- name: Run integration tests
run: pytest -m integration -q
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ __pycache__
*.db
.DS_Store
venv
.venv
files/
.env
docker-compose-dev.yml
Expand All @@ -19,4 +20,7 @@ annotrieve_missing_from_tracker.tsv
broken_source_urls.jsonl
TODO.txt
.pytest_cache/
.coverage
htmlcov/
coverage.xml
graphify-out/
Loading
Loading