-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (98 loc) · 3.4 KB
/
test.yml
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
110
111
112
name: Tests
on:
push:
branches:
- master
- main
tags:
- v*
pull_request:
branches:
- master
- main
- dev
jobs:
pytest:
runs-on: ubuntu-latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: ohdsi
services:
postgres:
image: postgres
env: # Set the environment variables for the service container - not sure why job-level env doesn't work here
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ env.POSTGRES_DB }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
recommendation-server:
image: glichtner/celida-recommendation-server:main
env:
GH_REPOSITORY: https://github.com/CODEX-CELIDA/celida-recommendations
options: >-
--health-cmd "curl -f -s http://localhost:80/health || exit 1"
--health-interval 30s
--health-timeout 10s
--health-retries 5
--health-start-period 30s
ports:
- 8000:80
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.SUBMODULE_PERSONAL_ACCESS_TOKEN }}
- name: Test Recommendation Server
run: |
curl http://localhost:8000/fhir/ActivityDefinition?url=https://www.netzwerk-universitaetsmedizin.de/fhir/codex-celida/guideline/covid19-inpatient-therapy/recommended-action/drug-administration-action/antithrombotic-prophylaxis-tinzaparin-administration
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Setup requirements
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Build Cython extension
run: python setup.py build_ext --inplace
- name: Test with pytest
env:
CELIDA_EE_FHIR_BASE_URL: http://localhost:8000/fhir
CELIDA_EE_FHIR_TERMINOLOGY_SERVER_URL: http://tx.fhir.org/r4
CELIDA_EE_TIMEZONE: Europe/Berlin
CELIDA_EE_OMOP__USER: ${{ env.POSTGRES_USER }}
CELIDA_EE_OMOP__PASSWORD: ${{ env.POSTGRES_PASSWORD }}
CELIDA_EE_OMOP__HOST: localhost
CELIDA_EE_OMOP__PORT: 5432
CELIDA_EE_OMOP__DATABASE: ${{ env.POSTGRES_DB }}
CELIDA_EE_OMOP__DATA_SCHEMA: cds_cdm
CELIDA_EE_OMOP__RESULT_SCHEMA: celida
CELIDA_EE_EPISODE_OF_CARE_VISIT_DETAIL: 0
CELIDA_EE_MULTIPROCESSING_USE: 0
CELIDA_EE_MULTIPROCESSING_POOL_SIZE: -1
run: |
pytest \
--color=yes \
--cov=execution_engine \
--cov-report=xml \
--postgresql-host=$CELIDA_EE_OMOP__HOST \
--postgresql-port=$CELIDA_EE_OMOP__PORT \
--postgresql-user=$CELIDA_EE_OMOP__USER \
--postgresql-password=$CELIDA_EE_OMOP__PASSWORD \
--run-slow-tests \
--run-recommendation-tests
- name: Coverage
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}