Skip to content
Open
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
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"
5 changes: 2 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
X_API_VERSION: "v3.1"

jobs:
server-docker-arm:
# This job checks if we can build our server package
Expand All @@ -25,6 +22,8 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 #v5.1.0

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

- uses: ./.github/actions/build-server
id: build
with:
Expand Down
66 changes: 26 additions & 40 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
X_PYTHON_MIN_VERSION: "3.10"
X_PYTHON_MAX_VERSION: "3.12"
X_API_VERSION: "v3.1"

jobs:
helper-scripts-static-analysis:
#This job runs static code analysis with ruff on the helper scripts in ./etc/scripts
Expand All @@ -26,77 +21,58 @@ jobs:
working-directory: ./etc/scripts
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 #v5.1.0
- uses: ./.github/actions/load-versions
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v7
with:
python-version: ${{ env.X_PYTHON_MIN_VERSION }}
- name: Install Ruff
# Revisit when Ruff version is specified in single source of truth
run: |
python -m pip install --upgrade pip
python -m pip install ruff==0.16.0
python -m pip install ruff==${{ env.X_RUFF_VERSION }}
- name: Check formatting and linting rules with Ruff
run: |
python -m ruff check
python -m ruff check

check-python-versions:
# This job checks that the Python Versions we support match and are not End of Life
check-global-versions:
# Verifies that (1) the supported Python versions are not EoL and (2) the values
# declared in `versions.yaml` coincide with every module's `pyproject.toml` and
# any listed `config.yaml` file.
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./etc/scripts
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 #v5.1.0
- uses: ./.github/actions/load-versions
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v7
with:
python-version: ${{ env.X_PYTHON_MIN_VERSION }}
cache: "pip"
cache-dependency-path: "./check_python_versions_requirements.txt"
cache-dependency-path: "./check_versions_requirements.txt"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r ./check_python_versions_requirements.txt
python -m pip install -r ./check_versions_requirements.txt
- name: Check Supported Python Versions
run: |
python check_python_versions_supported.py \
${{ env.X_PYTHON_MIN_VERSION }} \
${{ env.X_PYTHON_MAX_VERSION }}

- name: Check Python Versions coincide with all pyproject.toml Files
run: |
for file in ../../sdk/pyproject.toml ../../compliance_tool/pyproject.toml ../../server/pyproject.toml; do
python check_python_versions_coincide.py \
$file \
${{ env.X_PYTHON_MIN_VERSION }} \
${{ env.X_PYTHON_MAX_VERSION }}
done

- name: Check Python Versions coincide with all Dockerfiles
- name: Check versions.yaml coincides with pyproject.toml and config files
run: |
for file in ../../server/docker/repository/Dockerfile \
../../server/docker/registry/Dockerfile \
../../server/docker/discovery/Dockerfile; do
python check_python_versions_coincide.py --docker \
$file \
${{ env.X_PYTHON_MIN_VERSION }} \
${{ env.X_PYTHON_MAX_VERSION }}
done
python check_global_versions_coincide.py

sdk-test:
# This job runs the unittests on the python versions specified down at the matrix
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.12"]
python-version: ["3.11", "3.12"]
env:
COUCHDB_ADMIN_PASSWORD: "yo0Quai3"
# (2024-10-11, s-heppner)
# Specify the tag of the released schema files from https://github.com/admin-shell-io/aas-specs/releases
# that you want to use to test the serialization adapter against.
# Currently, we need to update this manually, however I'm afraid this is not possible to automatically infer,
# since it's heavily dependant of the version of the AAS specification we support.
AAS_SPECS_RELEASE_TAG: "v3.1.2"
services:
couchdb:
image: couchdb:3
Expand All @@ -110,6 +86,7 @@ jobs:
working-directory: ./sdk
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 #v5.1.0
- uses: ./.github/actions/load-versions
- name: Verify Matrix Version matches Global Version
run: |
if [ "${{ matrix.python-version }}" != "${{ env.X_PYTHON_MIN_VERSION }}" ] && [ "${{ matrix.python-version }}" != "${{ env.X_PYTHON_MAX_VERSION }}" ]; then
Expand All @@ -125,8 +102,8 @@ jobs:
- name: Collect schema files from aas-specs
run: |
mkdir -p ./test/adapter/schema
curl -sSLf -o ./test/adapter/schema/aasJSONSchema.json https://raw.githubusercontent.com/admin-shell-io/aas-specs-metamodel/refs/tags/${{ env.AAS_SPECS_RELEASE_TAG }}/schemas/json/aas.json
curl -sSLf -o ./test/adapter/schema/aasXMLSchema.xsd https://raw.githubusercontent.com/admin-shell-io/aas-specs-metamodel/refs/tags/${{ env.AAS_SPECS_RELEASE_TAG }}/schemas/xml/AAS.xsd
curl -sSLf -o ./test/adapter/schema/aasJSONSchema.json https://raw.githubusercontent.com/admin-shell-io/aas-specs-metamodel/refs/tags/${{ env.X_AAS_SPECS_RELEASE_TAG }}/schemas/json/aas.json
curl -sSLf -o ./test/adapter/schema/aasXMLSchema.xsd https://raw.githubusercontent.com/admin-shell-io/aas-specs-metamodel/refs/tags/${{ env.X_AAS_SPECS_RELEASE_TAG }}/schemas/xml/AAS.xsd
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -150,6 +127,7 @@ jobs:
working-directory: ./sdk
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 #v5.1.0
- uses: ./.github/actions/load-versions
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v7
with:
Expand All @@ -175,6 +153,7 @@ jobs:
working-directory: ./sdk
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 #v5.1.0
- uses: ./.github/actions/load-versions
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v7
with:
Expand Down Expand Up @@ -206,6 +185,7 @@ jobs:
working-directory: ./sdk
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 #v5.1.0
- uses: ./.github/actions/load-versions
- name: Set up Python ${{ env.X_PYTHON_MAX_VERSION }}
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v7
with:
Expand All @@ -228,6 +208,7 @@ jobs:
working-directory: ./sdk
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 #v5.1.0
- uses: ./.github/actions/load-versions
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v7
with:
Expand Down Expand Up @@ -257,7 +238,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.12"]
python-version: ["3.11", "3.12"]
defaults:
run:
working-directory: ./compliance_tool
Expand Down Expand Up @@ -303,6 +284,7 @@ jobs:
# Need tags so setuptools_scm builds the local sdk as >=1.0.0, else the loose
# `basyx-python-sdk>=1.0.0` pin lets pip replace it with the PyPI release.
fetch-depth: 0
- uses: ./.github/actions/load-versions
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v7
with:
Expand Down Expand Up @@ -331,6 +313,7 @@ jobs:
working-directory: ./compliance_tool
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 #v5.1.0
- uses: ./.github/actions/load-versions
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v7
with:
Expand All @@ -352,6 +335,7 @@ jobs:
working-directory: ./server
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 #v5.1.0
- uses: ./.github/actions/load-versions
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v7
with:
Expand Down Expand Up @@ -382,6 +366,8 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 #v5.1.0

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

- uses: ./.github/actions/build-server
id: build
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
working-directory: ./sdk
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 #v5.1.0
- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v7
with:
python-version: "3.10"
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -46,10 +46,10 @@ jobs:
working-directory: ./compliance_tool
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 #v5.1.0
- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v7
with:
python-version: "3.10"
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
4 changes: 2 additions & 2 deletions compliance_tool/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ classifiers = [
"Operating System :: OS Independent",
"Development Status :: 5 - Production/Stable"
]
requires-python = ">=3.10"
requires-python = ">=3.11"
dependencies = [
"pyecma376-2>=0.2.4",
"jsonschema>=4.21.1",
Expand All @@ -43,7 +43,7 @@ dependencies = [

[project.optional-dependencies]
dev = [
"mypy",
"mypy==1.15.0",
"pycodestyle",
"ruff==0.16.0",
"codeblocks",
Expand Down
Loading