-
Notifications
You must be signed in to change notification settings - Fork 13
61 lines (54 loc) · 1.9 KB
/
Copy pathmedcat-scripts_main.yml
File metadata and controls
61 lines (54 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: medcat-scripts - Test
on:
push:
branches: [ main ]
pull_request:
paths:
- 'medcat-scripts/**'
- '.github/workflows/medcat-scripts**'
defaults:
run:
working-directory: ./medcat-scripts
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
python-version: [ '3.10', '3.11', '3.12', '3.13' ]
max-parallel: 4
steps:
- uses: actions/checkout@v7
- name: Install uv for Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install the project
run: |
uv venv .venv
source .venv/bin/activate
uv run python -m ensurepip
uv pip install -r requirements.txt
uv pip install -r requirements-dev.txt
# reinstall MedCAT from local to test against changes in core lib
uv pip install "../medcat-v2[spacy,deid,meta-cat,rel-cat]"
- name: Check types
run: |
# NOTE: Only testing against .py files in this folder
uv run python -m mypy `git ls-tree --full-tree --name-only -r HEAD | grep ".py$" | grep "^medcat-scripts" | grep -v "tests/" | sed 's|^medcat-scripts/||'` --explicit-package-bases --follow-imports=normal
- name: Setup for notebook tests
run: |
# NOTE: this will make sure there's something in the den to work with below
uv run python tests/setup_for_tests.py
- name: Install IPython kernel
run: |
uv run python -m ipykernel install --name smoketests --user
- name: Run tests
run: |
uv run pytest tests
- name: Test notebooks
run: |
uv run pytest --collect-only --nbmake **/*.ipynb
uv run pytest --nbmake -n=auto --nbmake-kernel=smoketests --nbmake-timeout=1800 **/*.ipynb