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
96 changes: 96 additions & 0 deletions .github/workflows/packaging-smoke.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 11 additions & 0 deletions ci/packaging-smoke/vcpkg-consumer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
25 changes: 25 additions & 0 deletions ci/packaging-smoke/vcpkg-consumer/src/smoke.cpp
Original file line number Diff line number Diff line change
@@ -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 <it/d4np/memorypool/memory_pool.hpp>
#include <it/d4np/memorypool/typed_pool.hpp>

#include <cstdio>

int main() {
using namespace it::d4np::memorypool;

Pool pool(64, 16);
void* block = pool.try_allocate();
pool.deallocate(block);

TypedPool<int> 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;
}
4 changes: 4 additions & 0 deletions conan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ conan install . --build=missing
- [`conanfile.py`](conanfile.py) — the recipe: fetches the `v<version>` 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`:
Expand Down
4 changes: 4 additions & 0 deletions ports/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading