Skip to content

Commit f97c031

Browse files
authored
workflows: Add server ci, upgrade to @v4 (#336)
This expands the CI workflow to also test the server. For now, it only tests if the server can be build and run without error. This also upgrades the `actions/checkout@v2` to the newer `actions/checkout@v4`.
1 parent 8cc72d7 commit f97c031

File tree

1 file changed

+38
-10
lines changed

1 file changed

+38
-10
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ jobs:
3232
run:
3333
working-directory: ./sdk
3434
steps:
35-
- uses: actions/checkout@v2
35+
- uses: actions/checkout@v4
3636
- name: Set up Python ${{ matrix.python-version }}
37-
uses: actions/setup-python@v2
37+
uses: actions/setup-python@v4
3838
with:
3939
python-version: ${{ matrix.python-version }}
4040
- name: Collect schema files from aas-specs
@@ -64,9 +64,9 @@ jobs:
6464
run:
6565
working-directory: ./sdk
6666
steps:
67-
- uses: actions/checkout@v2
67+
- uses: actions/checkout@v4
6868
- name: Set up Python ${{ env.X_PYTHON_VERSION }}
69-
uses: actions/setup-python@v2
69+
uses: actions/setup-python@v4
7070
with:
7171
python-version: ${{ env.X_PYTHON_VERSION }}
7272
- name: Install Python dependencies
@@ -87,9 +87,9 @@ jobs:
8787
run:
8888
working-directory: ./sdk
8989
steps:
90-
- uses: actions/checkout@v2
90+
- uses: actions/checkout@v4
9191
- name: Set up Python ${{ env.X_PYTHON_VERSION }}
92-
uses: actions/setup-python@v2
92+
uses: actions/setup-python@v4
9393
with:
9494
python-version: ${{ env.X_PYTHON_VERSION }}
9595
- name: Install Python dependencies
@@ -113,9 +113,9 @@ jobs:
113113
run:
114114
working-directory: ./sdk
115115
steps:
116-
- uses: actions/checkout@v2
116+
- uses: actions/checkout@v4
117117
- name: Set up Python ${{ env.X_PYTHON_VERSION }}
118-
uses: actions/setup-python@v2
118+
uses: actions/setup-python@v4
119119
with:
120120
python-version: ${{ env.X_PYTHON_VERSION }}
121121
- name: Install Python dependencies
@@ -134,9 +134,9 @@ jobs:
134134
run:
135135
working-directory: ./sdk
136136
steps:
137-
- uses: actions/checkout@v2
137+
- uses: actions/checkout@v4
138138
- name: Set up Python ${{ env.X_PYTHON_VERSION }}
139-
uses: actions/setup-python@v2
139+
uses: actions/setup-python@v4
140140
with:
141141
python-version: ${{ env.X_PYTHON_VERSION }}
142142
- name: Install dependencies
@@ -146,3 +146,31 @@ jobs:
146146
- name: Create source and wheel dist
147147
run: |
148148
python -m build
149+
150+
server-package:
151+
# This job checks if we can build our server package
152+
runs-on: ubuntu-latest
153+
defaults:
154+
run:
155+
working-directory: ./server
156+
steps:
157+
- uses: actions/checkout@v4
158+
- name: Build the Docker image
159+
run: |
160+
docker build -t basyx-python-server .
161+
- name: Run container
162+
run: |
163+
docker run -d --name basyx-python-server basyx-python-server
164+
- name: Wait for container and server initialization
165+
run: |
166+
timeout 30s bash -c '
167+
until docker logs basyx-python-server 2>&1 | grep -q "INFO success: quit_on_failure entered RUNNING state"; do
168+
sleep 2
169+
done
170+
'
171+
- name: Check if container is running
172+
run: |
173+
docker inspect --format='{{.State.Running}}' basyx-python-server | grep true
174+
- name: Stop and remove the container
175+
run: |
176+
docker stop basyx-python-server && docker rm basyx-python-server

0 commit comments

Comments
 (0)