Repository navigation
111 lines (90 loc) · 3.07 KB
/
Copy pathcheck.run-tests.yml
File metadata and controls
111 lines (90 loc) · 3.07 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Run Tests
permissions:
contents: read
code-quality: write
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
run-tests:
name: Run Tests
runs-on: ubuntu-latest
env:
SKIP_DATABASE_TESTS: false
SKIP_LLM_TESTS: true
DB_HOST: "localhost"
DB_USER: "postgres"
DB_PASSWORD: "password"
DB_NAME: "omop"
DB_PORT: "5432"
DB_SCHEMA: "public"
DB_VECTABLE: "embeddings"
DB_VECSIZE: "384"
AUTH_API_KEY: "test_key_123"
steps:
- name: Checkout omop-lite repository
uses: actions/checkout@v7
with:
repository: Health-Informatics-UoN/omop-lite
path: omop-lite
ref: 31d6280947de78acd8a41928ef2a3da04b93cf43
- name: Checkout lettuce repository
uses: actions/checkout@v7
with:
path: lettuce
ref: ${{ github.head_ref }}
- name: Start omop-ts Docker services
run: |
docker compose -f omop-lite/docker-compose.yml --profile text-search up -d
echo "Waiting for database to initialise..."
sleep 15
- name: Check DNS resolution
run: |
nslookup localhost || echo "Failed to resolve hostname"
ping -c 3 localhost || echo "Failed to ping host"
- name: Inspect Docker networks
run: |
docker network ls
- name: Check running containers and their IPs
run: |
docker ps
docker inspect -f '{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -q)
- name: Setup uv
uses: astral-sh/setup-uv@v7
with:
version: "0.8.15"
enable-cache: true
cache-dependency-glob: "lettuce/lettuce/uv.lock"
- name: Setup musl
run: |
sudo apt-get install -y musl-dev
sudo ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version-file: "lettuce/lettuce/.python-version"
- name: uv sync
run: uv sync --extra test --extra llama-cpu
working-directory: lettuce/lettuce
- name: Run tests
run: |
set -e
INFERENCE_TYPE="llama-cpp-python" uv run pytest tests --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=lettuce tests | tee pytest-coverage.txt
test ${PIPESTATUS[0]} -eq 0
working-directory: lettuce/lettuce
- name: Cleanup Docker services
if: always()
run: |
# Cleanup all services to prevent resource issues
docker compose -f lettuce/lettuce/compose.yaml down
docker compose -f omop-lite/docker-compose.yml down
docker network rm omop-ts_default || true
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@9516bf7f32a9229cf18d5e1717ae387c7154f279
with:
pytest-coverage-path: pytest-coverage.txt
junitxml-path: pytest.xml