From e0ec3aab3b906a4610898e9c4c26f6ac2e828263 Mon Sep 17 00:00:00 2001 From: Daniel Polo <106583643+danielPoloWork@users.noreply.github.com> Date: Sun, 14 Jun 2026 22:13:19 +0200 Subject: [PATCH] ci: add packaging-smoke workflow for the vcpkg port and Conan recipe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Phase-2 packaging recipes (ADR-0030 vcpkg port, ADR-0031 Conan recipe) could not be exercised anywhere: vcpkg and Conan are not installable on the maintainer's box, and no CI job covered them. Add a packaging-smoke workflow that runs both end to end on ubuntu-latest: - vcpkg: install the overlay port (classic mode, as ports/README documents), then build + run a small consumer that does find_package(pbr_memory_pool) + link pbr::memory_pool. New fixture under ci/packaging-smoke/vcpkg-consumer/. - Conan: pipx install conan, profile detect, then `conan create conan/`, which builds the package and builds + runs the existing conan/test_package/. Both recipes fetch the SHA-pinned v1.0.0 source tag, so the jobs validate the recipes against the released artifact on current toolchains — not the working tree (an in-tree CMake change does not reach a version-pinned recipe until a release is tagged and the recipe re-pinned). The path filter is therefore limited to ports/**, conan/**, ci/packaging-smoke/**, and the workflow; a weekly schedule runs them regardless to catch toolchain / registry drift on the otherwise-static recipes. Uses node24 actions (checkout@v6), consistent with the recent runtime bump. Docs: CHANGELOG Unreleased > Added entry; ports/README.md and conan/README.md each gain a "CI smoke test" section. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/packaging-smoke.yml | 96 +++++++++++++++++++ CHANGELOG.md | 9 ++ .../vcpkg-consumer/CMakeLists.txt | 11 +++ .../vcpkg-consumer/src/smoke.cpp | 25 +++++ conan/README.md | 4 + ports/README.md | 4 + 6 files changed, 149 insertions(+) create mode 100644 .github/workflows/packaging-smoke.yml create mode 100644 ci/packaging-smoke/vcpkg-consumer/CMakeLists.txt create mode 100644 ci/packaging-smoke/vcpkg-consumer/src/smoke.cpp diff --git a/.github/workflows/packaging-smoke.yml b/.github/workflows/packaging-smoke.yml new file mode 100644 index 0000000..429cba1 --- /dev/null +++ b/.github/workflows/packaging-smoke.yml @@ -0,0 +1,96 @@ +name: packaging-smoke + +# Smoke-tests the Phase-2 packaging recipes end to end on CI: the vcpkg overlay +# port (ADR-0030) and the Conan 2.x recipe (ADR-0031). Both recipes are pinned to +# the published v1.0.0 source tag (SHA-verified downloads), so these jobs validate +# the *recipes against the released artifact* — that the port / recipe still +# configure, build, install, and expose the pbr::memory_pool imported target on +# current toolchains. +# +# They are deliberately NOT a test of the working tree: each recipe fetches the +# v1.0.0 tarball from GitHub, not local sources, so an in-tree CMake change does +# not reach them until a new release is tagged and the recipe re-pinned. That is +# why the path filter is limited to ports/**, conan/**, and this workflow — and why +# a weekly schedule runs them regardless, to catch toolchain / registry drift +# between releases. vcpkg and Conan cannot be installed on the maintainer's box, so +# CI is the only place these recipes are exercised. + +on: + pull_request: + paths: + - 'ports/**' + - 'conan/**' + - 'ci/packaging-smoke/**' + - '.github/workflows/packaging-smoke.yml' + push: + branches: [master] + paths: + - 'ports/**' + - 'conan/**' + - 'ci/packaging-smoke/**' + - '.github/workflows/packaging-smoke.yml' + schedule: + # Mondays 06:00 UTC — the recipes are version-pinned and rarely change, so the + # schedule is the main signal for toolchain / registry drift on a green tree. + - cron: '0 6 * * 1' + workflow_dispatch: + +permissions: + contents: read + +jobs: + vcpkg: + name: vcpkg overlay port — install + consume + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Install the overlay port (fetches v1.0.0, SHA512-pinned) + shell: bash + run: | + set -euo pipefail + VCPKG_ROOT="${VCPKG_INSTALLATION_ROOT:?GitHub-hosted runners provide vcpkg}" + "$VCPKG_ROOT/vcpkg" version + # Classic-mode install against the overlay, exactly as ports/README.md + # documents. Exercises the portfile: fetch + SHA512 verify, configure, + # install, vcpkg_cmake_config_fixup, vcpkg_fixup_pkgconfig. + "$VCPKG_ROOT/vcpkg" install pbr-memory-pool \ + --overlay-ports="$GITHUB_WORKSPACE/ports" + + - name: Build and run the consumer (find_package + link pbr::memory_pool) + shell: bash + run: | + set -euo pipefail + VCPKG_ROOT="${VCPKG_INSTALLATION_ROOT:?}" + cmake -S ci/packaging-smoke/vcpkg-consumer -B build/vcpkg-smoke \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" + cmake --build build/vcpkg-smoke + ./build/vcpkg-smoke/smoke + + conan: + name: Conan recipe — create + test_package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Install Conan 2.x + shell: bash + run: | + set -euo pipefail + # pipx is preinstalled on GitHub-hosted Ubuntu runners; it isolates + # Conan from the system Python (PEP 668) without a manual venv. + pipx install conan + conan --version + + - name: Detect a default profile + shell: bash + run: conan profile detect --force + + - name: conan create (fetches v1.0.0, SHA256-pinned; runs test_package) + shell: bash + run: | + set -euo pipefail + # Builds the package from the pinned source tag and then builds + runs + # conan/test_package/, which does find_package + link + run the example. + conan create conan/ --build=missing diff --git a/CHANGELOG.md b/CHANGELOG.md index 29cad7f..01a5d54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,15 @@ dated version block (`## [X.Y.Z] — YYYY-MM-DD`) when a release PR closes a mil Realizes the planned addition referenced by the post-release maintenance protocol ([`docs/workflow/maintenance.md`](docs/workflow/maintenance.md), which now links it). +- **`packaging-smoke` CI workflow** — end-to-end smoke tests for the Phase-2 + packaging recipes that cannot be built on the maintainer's box: a **vcpkg** + overlay-port install + consumer build (`find_package` + link `pbr::memory_pool`) + and a **Conan** `conan create` that runs the `test_package`. Both validate the + recipes against the SHA-pinned `v1.0.0` source tag, so they run on changes to + `ports/**` / `conan/**` / the workflow and on a weekly schedule (the recipes are + version-pinned, so the schedule is the main signal for toolchain / registry + drift). Adds a small `ci/packaging-smoke/vcpkg-consumer/` fixture; the Conan side + reuses the existing `conan/test_package/`. CI only; no API change. ### Changed diff --git a/ci/packaging-smoke/vcpkg-consumer/CMakeLists.txt b/ci/packaging-smoke/vcpkg-consumer/CMakeLists.txt new file mode 100644 index 0000000..abaf340 --- /dev/null +++ b/ci/packaging-smoke/vcpkg-consumer/CMakeLists.txt @@ -0,0 +1,11 @@ +# Minimal vcpkg consumer for the packaging-smoke workflow. Built against the +# overlay port (ports/pbr-memory-pool) with the vcpkg toolchain to prove the +# installed package exposes find_package(pbr_memory_pool) + pbr::memory_pool — +# the same imported target documented in ports/README.md. +cmake_minimum_required(VERSION 3.21) +project(pbr_vcpkg_smoke CXX) + +find_package(pbr_memory_pool CONFIG REQUIRED) + +add_executable(smoke src/smoke.cpp) +target_link_libraries(smoke PRIVATE pbr::memory_pool) diff --git a/ci/packaging-smoke/vcpkg-consumer/src/smoke.cpp b/ci/packaging-smoke/vcpkg-consumer/src/smoke.cpp new file mode 100644 index 0000000..7a6040e --- /dev/null +++ b/ci/packaging-smoke/vcpkg-consumer/src/smoke.cpp @@ -0,0 +1,25 @@ +// Minimal consumer for the vcpkg packaging smoke: construct a pool, allocate +// and free a block, and exercise the typed surface — proving the vcpkg-installed +// package links through the pbr::memory_pool imported target. Mirrors the Conan +// test_package example so both packaging paths assert the same public surface. +#include +#include + +#include + +int main() { + using namespace it::d4np::memorypool; + + Pool pool(64, 16); + void* block = pool.try_allocate(); + pool.deallocate(block); + + TypedPool typed(8); + int* value = typed.construct(7); + const int got = *value; + typed.destroy(value); + + std::printf("vcpkg smoke OK: got=%d block_size=%zu\n", got, + pool.block_size()); + return got == 7 ? 0 : 1; +} diff --git a/conan/README.md b/conan/README.md index cff5fdf..12a00fa 100644 --- a/conan/README.md +++ b/conan/README.md @@ -26,6 +26,10 @@ conan install . --build=missing - [`conanfile.py`](conanfile.py) — the recipe: fetches the `v` source tag (SHA256-pinned), builds with tests/benchmarks off via `CMakeToolchain` / `CMake`, installs, drops the upstream-bundled CMake config + `.pc` (Conan provides its own through `package_info`), and sets `cmake_file_name` / `cmake_target_name` so consumers get `pbr::memory_pool`. - [`test_package/`](test_package/) — a minimal consumer (`find_package` + link + run) that Conan builds during `conan create` to verify the package. +## CI smoke test + +The [`packaging-smoke`](../.github/workflows/packaging-smoke.yml) workflow runs `conan create conan/` — which builds the package from the pinned `v1.0.0` tag and then builds + runs the [`test_package/`](test_package/) consumer — on every change to `conan/**` and on a weekly schedule (the recipe is version-pinned, so the schedule is the main signal for Conan / toolchain drift). Conan cannot be run on the maintainer's box, so CI is where the recipe is exercised. + ## Publishing The recipe is written to ConanCenter conventions and can be contributed to [conan-io/conan-center-index](https://github.com/conan-io/conan-center-index) when desired (its layout there is `recipes/pbr-memory-pool/all/conanfile.py` + a `config.yml` mapping the version to the source). Alternatively, upload to a self-hosted Artifactory / `conan remote`: diff --git a/ports/README.md b/ports/README.md index fa16c83..3027daa 100644 --- a/ports/README.md +++ b/ports/README.md @@ -24,6 +24,10 @@ Or, in manifest mode, add `"pbr-memory-pool"` to your `vcpkg.json` `dependencies - [`pbr-memory-pool/vcpkg.json`](pbr-memory-pool/vcpkg.json) — manifest: name, version (`1.0.0`), license, and the `vcpkg-cmake` / `vcpkg-cmake-config` host tools. - [`pbr-memory-pool/portfile.cmake`](pbr-memory-pool/portfile.cmake) — fetches the `v${VERSION}` source tag (SHA512-pinned), configures with tests/benchmarks off, installs, then relocates the CMake config (`vcpkg_cmake_config_fixup`) and the pkg-config `.pc` (`vcpkg_fixup_pkgconfig`) into vcpkg's layout. +## CI smoke test + +The [`packaging-smoke`](../.github/workflows/packaging-smoke.yml) workflow installs this overlay port and builds a small consumer (`find_package(pbr_memory_pool)` + link `pbr::memory_pool`) on every change to `ports/**` and on a weekly schedule — the recipe is pinned to `v1.0.0`, so the schedule is the main signal for vcpkg / toolchain drift on an otherwise-static recipe. vcpkg cannot be run on the maintainer's box, so CI is where the port is exercised. + ## Submitting upstream to microsoft/vcpkg The port is written to the upstream conventions so it can be contributed to [microsoft/vcpkg](https://github.com/microsoft/vcpkg) when desired: