44 runner :
55 type : string
66 default : " ubuntu-latest"
7- secrets :
8- AA_TOKEN :
9- required : true
10- HUGGING_FACE_TOKEN :
11- required : true
7+ timeout :
8+ type : number
9+ default : 15 # mins
10+
11+ defaults :
12+ run :
13+ shell : bash
14+
1215jobs :
1316 lint :
14- defaults :
15- run :
16- shell : bash
17- timeout-minutes : 15
17+ timeout-minutes : ${{inputs.timeout}}
1818 runs-on : ${{inputs.runner}}
1919 steps :
2020 - name : Checkout repository
2121 uses : actions/checkout@v4
22-
23- - uses : actions/setup-python@v5
24- with :
25- python-version : " 3.10"
26-
27- - name : Install and configure Poetry
28- uses : snok/install-poetry@v1
29- with :
30- virtualenvs-create : true
31- virtualenvs-in-project : true
32- installer-parallel : true
33-
34- - name : Load cached venv
35- id : cached-poetry-dependencies
36- uses : actions/cache@v4
37- with :
38- path : .venv
39- key : venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
40-
41- - name : Install dependencies
42- if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
43- run : |
44- poetry config installer.max-workers 10
45- poetry install --no-interaction
22+ - uses : ./.github/composites/python-setup
4623
4724 - name : set PY for pre-commit
4825 run : echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
49-
5026 - uses : actions/cache@v4
5127 with :
5228 path : ~/.cache/pre-commit
@@ -56,37 +32,13 @@ jobs:
5632 run : |
5733 ./scripts/lint.sh
5834 doctest :
59- defaults :
60- run :
61- shell : bash
62- timeout-minutes : 15
35+ timeout-minutes : ${{inputs.timeout}}
6336 runs-on : ${{inputs.runner}}
6437 steps :
6538 - name : Checkout repository
6639 uses : actions/checkout@v4
67- - uses : actions/setup-python@v5
68- with :
69- python-version : " 3.10"
70-
71- - name : Install and configure Poetry
72- uses : snok/install-poetry@v1
73- with :
74- virtualenvs-create : true
75- virtualenvs-in-project : true
76- installer-parallel : true
40+ - uses : ./.github/composites/python-setup
7741
78- - name : Load cached venv
79- id : cached-poetry-dependencies
80- uses : actions/cache@v4
81- with :
82- path : .venv
83- key : venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
84-
85- - name : Install dependencies
86- if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
87- run : |
88- poetry config installer.max-workers 10
89- poetry install --no-interaction
9042 - name : Run doctest
9143 env :
9244 AA_TOKEN : ${{ secrets.AA_TOKEN }}
9547 run : ./scripts/doctest.sh
9648
9749 test :
98- defaults :
99- run :
100- shell : bash
101- timeout-minutes : 15
50+ timeout-minutes : ${{inputs.timeout}}
10251 runs-on : ${{inputs.runner}}
10352 services :
10453 argilla-elastic-search :
@@ -138,15 +87,16 @@ jobs:
13887 POSTGRES_USER : " il_sdk"
13988 POSTGRES_PASSWORD : " test"
14089 studio-backend :
141- image : registry.gitlab.aleph-alpha.de/product/studio/backend:latest
90+ image : registry.gitlab.aleph-alpha.de/product/studio/backend:v0.0.65
14291 ports :
14392 - " 8000:8000"
14493 env :
145- POSTGRES_HOST : " postgres"
146- POSTGRES_PORT : " 5432"
14794 POSTGRES_DB : " il_sdk"
14895 POSTGRES_USER : " il_sdk"
14996 POSTGRES_PASSWORD : " test"
97+ POSTGRES_HOST : " postgres"
98+ POSTGRES_PORT : " 5432"
99+
150100 AUTHORIZATION_SERVICE_URL : ${{ secrets.AUTHORIZATION_SERVICE_URL }}
151101 AA_TOKEN : ${{ secrets.AA_TOKEN }}
152102 API_SCHEDULER_URL : ${{ secrets.CLIENT_URL }}
@@ -157,53 +107,31 @@ jobs:
157107 steps :
158108 - name : Checkout repository
159109 uses : actions/checkout@v4
160-
161- - uses : actions/setup-python@v5
162- with :
163- python-version : " 3.10"
164-
165- - name : Install and configure Poetry
166- uses : snok/install-poetry@v1
167- with :
168- virtualenvs-create : true
169- virtualenvs-in-project : true
170- installer-parallel : true
171-
172- - name : Load cached venv
173- id : cached-poetry-dependencies
174- uses : actions/cache@v4
175- with :
176- path : .venv
177- key : venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
178-
179- - name : Install dependencies
180- if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
181- run : |
182- poetry config installer.max-workers 10
183- poetry install --no-interaction --without docs
110+ - uses : ./.github/composites/python-setup
184111
185112 - name : Run pytest
186113 env :
114+ POSTGRES_DB : " il_sdk"
115+ POSTGRES_USER : " il_sdk"
116+ POSTGRES_PASSWORD : " test"
117+ POSTGRES_HOST : " localhost"
118+ POSTGRES_PORT : " 5433"
119+
120+ AUTHORIZATION_SERVICE_URL : ${{ secrets.AUTHORIZATION_SERVICE_URL }}
187121 AA_TOKEN : ${{ secrets.AA_TOKEN }}
122+ DATA_SERVICE_URL : ${{secrets.DATA_SERVICE_URL}}
123+
188124 HUGGING_FACE_TOKEN : ${{ secrets.HUGGING_FACE_TOKEN }}
189125 ARGILLA_API_URL : " http://localhost:6900/"
190126 ARGILLA_API_KEY : " argilla.apikey"
191127 CLIENT_URL : ${{ secrets.CLIENT_URL }}
192128 STUDIO_URL : " http://localhost:8000/"
193129 DOCUMENT_INDEX_URL : ${{secrets.DOCUMENT_INDEX_URL}}
194130 PHARIA_KERNEL_URL : https://pharia-kernel.product.pharia.com
195- POSTGRES_HOST : " localhost"
196- POSTGRES_PORT : " 5433"
197- POSTGRES_DB : " il_sdk"
198- POSTGRES_USER : " il_sdk"
199- POSTGRES_PASSWORD : " test"
200131 run : |
201132 ./scripts/test.sh
202133 run-notebooks :
203- defaults :
204- run :
205- shell : bash
206- timeout-minutes : 15
134+ timeout-minutes : ${{inputs.timeout}}
207135 runs-on : ${{inputs.runner}}
208136 services :
209137 argilla-elastic-search :
@@ -228,15 +156,16 @@ jobs:
228156 POSTGRES_USER : " il_sdk"
229157 POSTGRES_PASSWORD : " test"
230158 studio-backend :
231- image : registry.gitlab.aleph-alpha.de/product/studio/backend:latest
159+ image : registry.gitlab.aleph-alpha.de/product/studio/backend:v0.0.65
232160 ports :
233161 - " 8001:8000"
234162 env :
235- POSTGRES_HOST : " postgres"
236- POSTGRES_PORT : " 5432"
237163 POSTGRES_DB : " il_sdk"
238164 POSTGRES_USER : " il_sdk"
239165 POSTGRES_PASSWORD : " test"
166+ POSTGRES_HOST : " postgres"
167+ POSTGRES_PORT : " 5432"
168+
240169 AUTHORIZATION_SERVICE_URL : ${{ secrets.AUTHORIZATION_SERVICE_URL }}
241170 AA_TOKEN : ${{ secrets.AA_TOKEN }}
242171 API_SCHEDULER_URL : ${{ secrets.CLIENT_URL }}
@@ -247,28 +176,9 @@ jobs:
247176 steps :
248177 - name : Checkout repository
249178 uses : actions/checkout@v4
250- - uses : actions/setup-python@v5
251- with :
252- python-version : " 3.10"
253- - name : Install and configure Poetry
254- uses : snok/install-poetry@v1
255- with :
256- virtualenvs-create : true
257- virtualenvs-in-project : true
258- installer-parallel : true
179+ - uses : ./.github/composites/python-setup
259180
260- - name : Load cached venv
261- id : cached-poetry-dependencies
262- uses : actions/cache@v4
263- with :
264- path : .venv
265- key : venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
266- - name : Install dependencies
267- if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
268- run : |
269- poetry config installer.max-workers 10
270- poetry install --no-interaction
271- - name : Configure Poetry for notebooks and run
181+ - name : Run Notebooks
272182 env :
273183 AA_TOKEN : ${{ secrets.AA_TOKEN }}
274184 HUGGING_FACE_TOKEN : ${{ secrets.HUGGING_FACE_TOKEN }}
0 commit comments