@@ -3,15 +3,47 @@ name: ci
3
3
on : [push, pull_request]
4
4
5
5
env :
6
- X_PYTHON_VERSION : " 3.12"
6
+ X_PYTHON_MIN_VERSION : " 3.9"
7
+ X_PYTHON_MAX_VERSION : " 3.12"
7
8
8
9
jobs :
10
+ check-python-versions :
11
+ # This job checks that the Python Versions we support match and are not End of Life
12
+ runs-on : ubuntu-latest
13
+ defaults :
14
+ run :
15
+ working-directory : ./etc/scripts
16
+ steps :
17
+ - uses : actions/checkout@v2
18
+ - name : Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
19
+ uses : actions/setup-python@v2
20
+ with :
21
+ python-version : ${{ env.X_PYTHON_MIN_VERSION }}
22
+ - name : Install Python dependencies
23
+ run : |
24
+ python -m pip install --upgrade pip
25
+ pip install -r ./check_python_versions_requirements.txt
26
+ - name : Check Supported Python Versions
27
+ run : |
28
+ python check_python_versions_supported.py \
29
+ ${{ env.X_PYTHON_MIN_VERSION }} \
30
+ ${{ env.X_PYTHON_MAX_VERSION }}
31
+
32
+ - name : Check Python Versions coincide with the SDKs pyproject.toml
33
+ run : |
34
+ python check_python_versions_coincide.py \
35
+ ../../sdk/pyproject.toml \
36
+ ${{ env.X_PYTHON_MIN_VERSION }} \
37
+ ${{ env.X_PYTHON_MAX_VERSION }}
38
+
39
+ # Todo: Check other pyproject.toml here as well, as we add them
40
+
9
41
sdk-test :
10
42
# This job runs the unittests on the python versions specified down at the matrix
11
43
runs-on : ubuntu-latest
12
44
strategy :
13
45
matrix :
14
- python-version : ["3.8", "3.10 ", "3.12"]
46
+ python-version : ["3.9 ", "3.12"]
15
47
env :
16
48
COUCHDB_ADMIN_PASSWORD : " yo0Quai3"
17
49
# (2024-10-11, s-heppner)
32
64
run :
33
65
working-directory : ./sdk
34
66
steps :
35
- - uses : actions/checkout@v2
67
+ - uses : actions/checkout@v4
68
+ - name : Verify Matrix Version matches Global Version
69
+ run : |
70
+ if [ "${{ matrix.python-version }}" != "${{ env.X_PYTHON_MIN_VERSION }}" ] && [ "${{ matrix.python-version }}" != "${{ env.X_PYTHON_MAX_VERSION }}" ]; then
71
+ echo "Error: Matrix version ${{ matrix.python-version }} does not match global version."
72
+ exit 1
73
+ fi
36
74
- name : Set up Python ${{ matrix.python-version }}
37
- uses : actions/setup-python@v2
75
+ uses : actions/setup-python@v4
38
76
with :
39
77
python-version : ${{ matrix.python-version }}
40
78
- name : Collect schema files from aas-specs
@@ -64,11 +102,11 @@ jobs:
64
102
run :
65
103
working-directory : ./sdk
66
104
steps :
67
- - uses : actions/checkout@v2
68
- - name : Set up Python ${{ env.X_PYTHON_VERSION }}
105
+ - uses : actions/checkout@v4
106
+ - name : Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
69
107
uses : actions/setup-python@v2
70
108
with :
71
- python-version : ${{ env.X_PYTHON_VERSION }}
109
+ python-version : ${{ env.X_PYTHON_MIN_VERSION }}
72
110
- name : Install Python dependencies
73
111
run : |
74
112
python -m pip install --upgrade pip
@@ -87,11 +125,11 @@ jobs:
87
125
run :
88
126
working-directory : ./sdk
89
127
steps :
90
- - uses : actions/checkout@v2
91
- - name : Set up Python ${{ env.X_PYTHON_VERSION }}
128
+ - uses : actions/checkout@v4
129
+ - name : Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
92
130
uses : actions/setup-python@v2
93
131
with :
94
- python-version : ${{ env.X_PYTHON_VERSION }}
132
+ python-version : ${{ env.X_PYTHON_MIN_VERSION }}
95
133
- name : Install Python dependencies
96
134
run : |
97
135
python -m pip install --upgrade pip
@@ -113,11 +151,11 @@ jobs:
113
151
run :
114
152
working-directory : ./sdk
115
153
steps :
116
- - uses : actions/checkout@v2
117
- - name : Set up Python ${{ env.X_PYTHON_VERSION }}
154
+ - uses : actions/checkout@v4
155
+ - name : Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
118
156
uses : actions/setup-python@v2
119
157
with :
120
- python-version : ${{ env.X_PYTHON_VERSION }}
158
+ python-version : ${{ env.X_PYTHON_MIN_VERSION }}
121
159
- name : Install Python dependencies
122
160
run : |
123
161
python -m pip install --upgrade pip
@@ -134,11 +172,11 @@ jobs:
134
172
run :
135
173
working-directory : ./sdk
136
174
steps :
137
- - uses : actions/checkout@v2
138
- - name : Set up Python ${{ env.X_PYTHON_VERSION }}
175
+ - uses : actions/checkout@v4
176
+ - name : Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
139
177
uses : actions/setup-python@v2
140
178
with :
141
- python-version : ${{ env.X_PYTHON_VERSION }}
179
+ python-version : ${{ env.X_PYTHON_MIN_VERSION }}
142
180
- name : Install dependencies
143
181
run : |
144
182
python -m pip install --upgrade pip
@@ -147,6 +185,7 @@ jobs:
147
185
run : |
148
186
python -m build
149
187
188
+
150
189
compliance-tool-test :
151
190
# This job runs the unittests on the python versions specified down at the matrix
152
191
runs-on : ubuntu-latest
@@ -249,3 +288,32 @@ jobs:
249
288
- name : Create source and wheel dist
250
289
run : |
251
290
python setup.py sdist bdist_wheel
291
+
292
+ server-package :
293
+ # This job checks if we can build our server package
294
+ runs-on : ubuntu-latest
295
+ defaults :
296
+ run :
297
+ working-directory : ./server
298
+ steps :
299
+ - uses : actions/checkout@v4
300
+ - name : Build the Docker image
301
+ run : |
302
+ docker build -t basyx-python-server .
303
+ - name : Run container
304
+ run : |
305
+ docker run -d --name basyx-python-server basyx-python-server
306
+ - name : Wait for container and server initialization
307
+ run : |
308
+ timeout 30s bash -c '
309
+ until docker logs basyx-python-server 2>&1 | grep -q "INFO success: quit_on_failure entered RUNNING state"; do
310
+ sleep 2
311
+ done
312
+ '
313
+ - name : Check if container is running
314
+ run : |
315
+ docker inspect --format='{{.State.Running}}' basyx-python-server | grep true
316
+ - name : Stop and remove the container
317
+ run : |
318
+ docker stop basyx-python-server && docker rm basyx-python-server
319
+
0 commit comments