From 2249054359d85994878cddcd9f1126db5de0f020 Mon Sep 17 00:00:00 2001 From: Ron <45816308+rjaegers@users.noreply.github.com> Date: Sat, 4 Jul 2026 11:46:01 +0000 Subject: [PATCH 1/3] feat: add docs flavor --- .devcontainer/docs-test/devcontainer.json | 4 + .devcontainer/docs/Dockerfile | 34 ++ .devcontainer/docs/apt-requirements.json | 5 + .devcontainer/docs/devcontainer-metadata.json | 16 + .devcontainer/docs/devcontainer.json | 31 ++ .devcontainer/docs/requirements.in | 1 + .devcontainer/docs/requirements.txt | 293 ++++++++++++++++++ .github/RELEASE_TEMPLATE.md | 11 +- .github/dependabot.yml | 1 + .github/workflows/build-push-test.yml | 2 +- .github/workflows/image-cleanup.yml | 2 +- .github/workflows/pr-image-cleanup.yml | 2 +- .github/workflows/release-build.yml | 2 +- .github/workflows/update-dependencies.yml | 4 +- .github/workflows/vulnerability-scan.yml | 2 +- README.md | 14 +- test/docs/integration-tests.bats | 85 +++++ test/docs/workspace/diagram.puml | 4 + test/docs/workspace/graph.dot | 4 + test/docs/workspace/sample.sbdl | 5 + 20 files changed, 506 insertions(+), 16 deletions(-) create mode 100644 .devcontainer/docs-test/devcontainer.json create mode 100644 .devcontainer/docs/Dockerfile create mode 100644 .devcontainer/docs/apt-requirements.json create mode 100644 .devcontainer/docs/devcontainer-metadata.json create mode 100644 .devcontainer/docs/devcontainer.json create mode 100644 .devcontainer/docs/requirements.in create mode 100644 .devcontainer/docs/requirements.txt create mode 100644 test/docs/integration-tests.bats create mode 100644 test/docs/workspace/diagram.puml create mode 100644 test/docs/workspace/graph.dot create mode 100644 test/docs/workspace/sample.sbdl diff --git a/.devcontainer/docs-test/devcontainer.json b/.devcontainer/docs-test/devcontainer.json new file mode 100644 index 000000000..80efc7c32 --- /dev/null +++ b/.devcontainer/docs-test/devcontainer.json @@ -0,0 +1,4 @@ +{ + "image": "ghcr.io/philips-software/amp-devcontainer-docs:${localEnv:IMAGE_VERSION}", + "workspaceFolder": "/workspaces/amp-devcontainer/test/docs/workspace" +} diff --git a/.devcontainer/docs/Dockerfile b/.devcontainer/docs/Dockerfile new file mode 100644 index 000000000..a44fab8f3 --- /dev/null +++ b/.devcontainer/docs/Dockerfile @@ -0,0 +1,34 @@ +# syntax=docker/dockerfile:1 + +ARG BASE_IMAGE=ghcr.io/philips-software/amp-devcontainer-base:edge +FROM ${BASE_IMAGE} + +ARG DEBIAN_FRONTEND=noninteractive + +HEALTHCHECK NONE + +SHELL ["/bin/bash", "-Eeuo", "pipefail", "-c"] + +# Set default environment options +ENV PYTHONPYCACHEPREFIX=/cache/.python + +# Install the base system with all tool dependencies +RUN --mount=type=bind,source=.devcontainer/docs/apt-requirements.json,target=/tmp/apt-requirements.json \ + --mount=type=bind,source=.devcontainer/docs/requirements.txt,target=/tmp/requirements.txt \ + --mount=type=cache,target=/cache,sharing=locked \ + --mount=type=cache,target=/var/cache/apt,sharing=locked \ + --mount=type=cache,target=/var/lib/apt,sharing=locked \ + --mount=type=cache,target=/var/log,sharing=locked <&1 | to_semver) + + assert_equal "$INSTALLED_VERSION" "$EXPECTED_VERSION" +} + +# bats test_tags=Version,Pip +@test "pip version should be aligned with the expected version" { + EXPECTED_VERSION=$(get_expected_semver_for python3-pip) + INSTALLED_VERSION=$(pip --version | to_semver) + + assert_equal "$INSTALLED_VERSION" "$EXPECTED_VERSION" +} + +# bats test_tags=Version,Sbdl +@test "sbdl version should be aligned with the expected version" { + EXPECTED_VERSION=$(grep sbdl ${BATS_TEST_DIRNAME}/../../.devcontainer/docs/requirements.in | to_semver) + INSTALLED_VERSION=$(sbdl --version | to_semver) + + assert_equal "$INSTALLED_VERSION" "$EXPECTED_VERSION" +} + +## This section contains tests for the functional correctness of the installed tools. + +# bats test_tags=Functional,Plantuml +@test "plantuml should render a diagram to a png image" { + run plantuml -o build -tpng diagram.puml + + assert_success + assert [ -f build/diagram.png ] +} + +# bats test_tags=Functional,Graphviz +@test "graphviz should render a graph to an svg image" { + run dot -Tsvg graph.dot + + assert_success + assert_output --partial " Bob: Authentication Request +Bob --> Alice: Authentication Response +@enduml diff --git a/test/docs/workspace/graph.dot b/test/docs/workspace/graph.dot new file mode 100644 index 000000000..3f08981a1 --- /dev/null +++ b/test/docs/workspace/graph.dot @@ -0,0 +1,4 @@ +digraph { + a -> b; + b -> c; +} diff --git a/test/docs/workspace/sample.sbdl b/test/docs/workspace/sample.sbdl new file mode 100644 index 000000000..d6c1957df --- /dev/null +++ b/test/docs/workspace/sample.sbdl @@ -0,0 +1,5 @@ +#!sbdl +req-doc-0001 is requirement { + custom:title is "Sample requirement" + description is "A sample requirement used to validate the sbdl toolchain" +} From f9ce339360af63412177c4d5923d4524164142ae Mon Sep 17 00:00:00 2001 From: Ron <45816308+rjaegers@users.noreply.github.com> Date: Sat, 4 Jul 2026 11:54:50 +0000 Subject: [PATCH 2/3] docs: minor re-word of README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 396a1cb8d..fe27eb07e 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ It consolidates common tooling (e.g. certificates and test tooling) so that the #### amp-devcontainer-cpp -The amp-devcontainer-cpp built from this repository contains compilers and tools to facilitate modern C++ development. +The amp-devcontainer-cpp image built from this repository contains compilers and tools to facilitate modern C++ development. The amp-devcontainer-cpp includes support for host- and cross-compilation using gcc and clang compilers. Next to the compilers there is support for package management (using [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake) and [Conan](https://conan.io/)) code-coverage measurement, mutation testing (using [mull](https://github.com/mull-project/mull)), fuzzing (using [libfuzzer](https://www.llvm.org/docs/LibFuzzer.html)) and static analysis and formatting (clang-format, clang-tidy, clangd, include-what-you-use). @@ -83,7 +83,7 @@ It includes [sbdl](https://sbdl.dev/) to capture the essence of system compositi #### amp-devcontainer-embedded-cpp -The amp-devcontainer-embedded-cpp built from this repository contains the same tooling as amp-devcontainer-cpp, extended with support for embedded C++ development. +The amp-devcontainer-embedded-cpp image built from this repository contains the same tooling as amp-devcontainer-cpp, extended with support for embedded C++ development. On top of the host- and cross-compilation support it adds the arm-gcc (arm-none-eabi) toolchain for cross-compilation towards the ARM Cortex architecture, together with debugging support for micro-controllers (using [cortex-debug](https://github.com/Marus/cortex-debug) and gdb-multiarch). The default build system is set up to use CMake, Ninja and CCache. From 7974470decb2b7aa3407f0d642bb51976731fd00 Mon Sep 17 00:00:00 2001 From: Ron <45816308+rjaegers@users.noreply.github.com> Date: Sat, 4 Jul 2026 14:29:30 +0000 Subject: [PATCH 3/3] ci: use docs flavor --- .github/workflows/wc-document-generation.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/wc-document-generation.yml b/.github/workflows/wc-document-generation.yml index 0683f8cb2..78552c8f5 100644 --- a/.github/workflows/wc-document-generation.yml +++ b/.github/workflows/wc-document-generation.yml @@ -15,6 +15,7 @@ jobs: generate-documents: name: Generate Documents runs-on: ubuntu-latest + container: ghcr.io/philips-software/amp-devcontainer-docs:pr-1335 permissions: contents: read steps: @@ -24,12 +25,6 @@ jobs: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - - name: Install dependencies - run: | - set -Eeuo pipefail - - sudo apt-get update && sudo apt-get install --no-install-recommends -y plantuml - python -m pip install sbdl==1.22.7 - name: Build & Validate SBDL model run: sbdl -m compile test/cpp/integration-tests.bats test/cpp/features/*.feature test/embedded-cpp/integration-tests.bats test/embedded-cpp/features/*.feature > amp-devcontainer.sbdl - name: Create document control context