@@ -9,9 +9,25 @@ concurrency:
9
9
cancel-in-progress : true
10
10
11
11
jobs :
12
+ preconditions :
13
+ name : Preconditions
14
+ runs-on : ubuntu-latest
15
+ outputs :
16
+ notebooks : ${{ steps.filter.outputs.notebooks }}
17
+ e2e_tests : ${{ steps.filter.outputs.e2e_tests }}
18
+ docker_examples : ${{ steps.filter.outputs.docker_examples }}
19
+ steps :
20
+ - uses : actions/checkout@v4
21
+ - uses : dorny/paths-filter@v2
22
+ id : filter
23
+ with :
24
+ filters : ./.github/changes-filter.yaml
25
+
12
26
build-docker :
13
27
name : Docker
14
28
runs-on : ubuntu-latest
29
+ needs : ["preconditions"]
30
+ if : ${{ needs.preconditions.outputs.docker_examples == 'true' }}
15
31
steps :
16
32
- name : Check out the repo
17
33
uses : actions/checkout@v4
33
49
34
50
unit-tests :
35
51
name : Unit Tests (Python ${{ matrix.python-version }})
52
+ needs : ["preconditions"]
36
53
runs-on : ubuntu-latest
37
54
strategy :
38
55
matrix :
@@ -55,50 +72,47 @@ jobs:
55
72
uses : ./.github/actions/lint
56
73
57
74
- name : " Unit tests (root)"
58
- if : ${{ matrix.python-version != '3.12' }}
59
75
run : tox -e unit-tests && rm -rf .tox
60
76
61
77
- name : " Unit tests (colbert)"
78
+ if : ${{ needs.preconditions.outputs.libs_colbert == 'true'}}
62
79
run : tox -e unit-tests -c libs/colbert && rm -rf libs/colbert/.tox
63
80
64
81
- name : " Unit tests (langchain)"
82
+ if : ${{ needs.preconditions.outputs.libs_langchain == 'true'}}
65
83
run : tox -e unit-tests -c libs/langchain && rm -rf libs/langchain/.tox
66
84
67
85
- name : " Unit tests (llamaindex)"
86
+ if : ${{ needs.preconditions.outputs.libs_llamaindex == 'true'}}
68
87
run : tox -e unit-tests -c libs/llamaindex && rm -rf libs/llamaindex/.tox
69
88
70
89
- name : " Unit tests (knowledge-store)"
71
- if : ${{ matrix.python-version != '3.9' }}
90
+ if : ${{ needs.preconditions.outputs.libs_knowledge_store == 'true' && matrix.python-version != '3.9' }}
72
91
env :
73
92
OPENAI_API_KEY : " ${{ secrets.E2E_TESTS_OPEN_AI_KEY }}"
74
93
run : tox -e unit-tests -c libs/knowledge-store && rm -rf libs/knowledge-store/.tox
75
94
76
95
- name : " Unit tests (knowledge-graph)"
77
- if : ${{ matrix.python-version != '3.9' && matrix.python-version != '3.10' }}
96
+ if : ${{ needs.preconditions.outputs.libs_knowledge_graph == 'true' && matrix.python-version != '3.9' && matrix.python-version != '3.10' }}
78
97
env :
79
98
OPENAI_API_KEY : " ${{ secrets.E2E_TESTS_OPEN_AI_KEY }}"
80
99
run : tox -e unit-tests -c libs/knowledge-graph && rm -rf libs/knowledge-graph/.tox
81
100
82
101
integration-tests :
83
102
name : Integration Tests
84
103
runs-on : ubuntu-latest
104
+ if : ${{ needs.preconditions.outputs.integration_tests == 'true' }}
105
+ needs : ["preconditions"]
85
106
timeout-minutes : 30
86
107
steps :
87
108
- name : Check out the repo
88
109
uses : actions/checkout@v4
89
110
90
- - uses : dorny/paths-filter@v2
91
- id : filter
92
- with :
93
- filters : ./.github/changes-filter.yaml
94
-
95
111
- name : " Setup: Python 3.11"
96
- if : ${{ steps.filter.outputs.integration_tests == 'true' }}
97
112
uses : ./.github/actions/setup-python
98
113
99
114
- name : Setup AstraDB
100
115
uses : nicoloboschi/setup-astradb@v1
101
- if : ${{ steps.filter.outputs.integration_tests == 'true' }}
102
116
id : astra-db
103
117
with :
104
118
token : ${{ secrets.E2E_TESTS_ASTRA_DEV_DB_TOKEN }}
@@ -107,7 +121,6 @@ jobs:
107
121
cloud : " gcp"
108
122
109
123
- name : " Integration tests"
110
- if : ${{ steps.filter.outputs.integration_tests == 'true' }}
111
124
env :
112
125
ASTRA_DB_TOKEN : " ${{ secrets.E2E_TESTS_ASTRA_DEV_DB_TOKEN }}"
113
126
ASTRA_DB_ID : " ${{ steps.astra-db.outputs.id }}"
@@ -126,7 +139,7 @@ jobs:
126
139
127
140
- name : Cleanup AstraDB
128
141
uses : nicoloboschi/cleanup-astradb@v1
129
- if : ${{ always() && steps.filter .outputs.integration_tests == 'true ' }}
142
+ if : ${{ always() && steps.astra-db .outputs.name != ' ' }}
130
143
with :
131
144
token : ${{ secrets.E2E_TESTS_ASTRA_DEV_DB_TOKEN }}
132
145
name : ${{ steps.astra-db.outputs.name }}
0 commit comments