Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file features commits that should be taken out of the git blame chain as they would clutter it with formatting
# changes otherwise.

# To ignore the commits, you can configure your git to automatically use this file with any git blame command:
# git config blame.ignoreRevsFile .git-blame-ignore-revs

# Commit 2026-07-23: Introduce ruff as linter and formatter
# This commit had no effect on the functionality but touched and reformatted 10k lines
112290a101f681030b7f895ded63a544764c073a
72 changes: 72 additions & 0 deletions .github/actions/build-server/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: build-server
description: Sets up the build context and builds a docker image
inputs:
server-profile:
required: true
description: The profile of the server to build (discovery, registry, repository)
load:
required: false
description: Set to "true" to use image in further steps (only works for single architecture builds)
default: "false"
platform:
required: false
description: The target platforms to build the image for
default: "linux/amd64"
publish:
required: false
description: Set to "true" to publish image to Docker Hub (requires login)
default: "false"

outputs:
image-ref:
description: Reference to the locally-runnable image (valid if load="true")
value: ${{ steps.naming.outputs.image-name }}:${{ steps.naming.outputs.local-tag }}

runs:
using: composite
steps:
- name: Setup QEMU
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 #v4.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c #v4.2.0

- name: Generate Image Title
id: naming
shell: bash
run: |
profile="${{ inputs.server-profile }}"
echo "profile-title=${profile^}" >> "$GITHUB_OUTPUT"
echo "image-name=eclipsebasyx/basyx-python-${{ inputs.server-profile }}" >> $GITHUB_OUTPUT
echo "local-tag=ci-${{ github.run_id }}" >> $GITHUB_OUTPUT

- name: Extract Docker image metadata
id: meta
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 #v6.2.0
with:
images: ${{ steps.naming.outputs.image-name }}
# This fetches the latest git tag and adds an additional "latest" to it, so e.g. `2.1.0,latest`
tags: |
type=semver,pattern={{version}}
type=raw,value=latest,enable=${{ inputs.publish == 'true' && true || false }}
type=raw,value=${{ steps.naming.outputs.local-tag }},enable=${{ inputs.load == 'true' && true || false }}
labels: |
org.opencontainers.image.title=BaSyx Python ${{ steps.naming.outputs.profile-title }} Service
org.opencontainers.image.description=Eclipse BaSyx Python SDK - ${{ steps.naming.outputs.profile-title }} HTTP Server
org.opencontainers.image.source=https://github.com/eclipse-basyx/basyx-python-sdk/tree/main/server
org.opencontainers.image.licenses=MIT

- name: Build Docker Image
id: build
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a #v7.3.0
with:
context: ./server
build-contexts: |
sdk=./sdk
license=.
file: ./server/docker/${{ inputs.server-profile }}/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ inputs.platform }}
push: ${{ inputs.publish == 'true' && true || false }}
load: ${{ inputs.load == 'true' && true || false }}
19 changes: 19 additions & 0 deletions .github/actions/load-versions/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: load-versions
description: >
Loads values from the repo-root versions.toml into environment variables
for the current job (via GITHUB_ENV). Downstream steps consume the values
through the usual env context. Requires actions/checkout to have run first.

runs:
using: composite
steps:
- shell: bash
run: |
{
echo "X_PYTHON_MIN_VERSION=$(yq -p toml '.python.min' versions.toml)"
echo "X_PYTHON_MAX_VERSION=$(yq -p toml '.python.max' versions.toml)"
echo "X_MYPY_VERSION=$(yq -p toml '.dev_tools.mypy' versions.toml)"
echo "X_RUFF_VERSION=$(yq -p toml '.dev_tools.ruff' versions.toml)"
echo "X_API_VERSION=$(yq -p toml '.spec.api_version' versions.toml)"
echo "X_AAS_SPECS_RELEASE_TAG=$(yq -p toml '.spec.aas' versions.toml)"
} >> "$GITHUB_ENV"
49 changes: 49 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: main
on:
pull_request:
branches: [main]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
server-docker-arm:
# This job checks if we can build our server package
runs-on: ubuntu-24.04-arm
strategy:
matrix:
profile: [ "repository", "discovery", "registry" ]
fail-fast: false
steps:
- name: Checkout Repository
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 #v5.1.0

- uses: ./.github/actions/load-versions

- uses: ./.github/actions/build-server
id: build
with:
server-profile: ${{ matrix.profile }}
load: true
publish: false
platform: linux/arm64
- name: Run container
run: |
docker run -d --name basyx-python-${{ matrix.profile }} -p 9080:80 --pull=never ${{ steps.build.outputs.image-ref }}
- name: Wait for container and server initialization
run: |
timeout 30s bash -c '
until docker logs basyx-python-${{ matrix.profile }} 2>&1 | grep -q "INFO success: quit_on_failure entered RUNNING state"; do
sleep 2
done
'
- name: Check if service is alive
run: |
curl -f http://localhost:9080/api/${{ env.X_API_VERSION }}/description
- name: Stop and remove the container
run: |
docker stop basyx-python-${{ matrix.profile }} && docker rm basyx-python-${{ matrix.profile }}
Loading
Loading