Skip to content
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
caf4bdb
Migrate template engine from Cookiecutter to Copier
steve-downey Jun 18, 2026
c379fb3
Document Copier workflow and migration path
steve-downey Jun 18, 2026
9f4b14a
Randomize CI cron schedules via Copier defaults
steve-downey Jun 18, 2026
80ead4c
Add template sync tooling and CI test matrix
steve-downey Jun 18, 2026
a10401b
Add MAINTAINERS documentation for template pipeline
steve-downey Jun 18, 2026
ff2b47e
Bump infra submodule to latest upstream main
steve-downey Jun 18, 2026
18974fd
Sync templates with repo state after rebase onto main
steve-downey Jun 18, 2026
f4ccad9
Fix non-exemplar template parity with cookiecutter output
steve-downey Jun 18, 2026
66b1f43
Add SPDX license identifier to .copier-answers.yml template
steve-downey Jun 18, 2026
65e5364
Merge branch 'main' into copier
steve-downey Jul 11, 2026
255e5b4
Fix test_standard_project shebang; auto-format generated projects
steve-downey Jul 11, 2026
eeaffc6
Add copier-lint job to ci_tests template
steve-downey Jul 12, 2026
431efb2
Update infra from upstream
steve-downey Jul 13, 2026
706513d
Merge branch 'main' into copier-readme
steve-downey Jul 25, 2026
3c9e118
Merge and fix template for beman-tidy updates
steve-downey Jul 25, 2026
a44a299
Merge pull request #5 from steve-downey/copier-readme
steve-downey Jul 25, 2026
ae17fbb
Merge remote-tracking branch 'upstream/main' into copier
steve-downey Aug 1, 2026
b0e261d
Document Copier VCS version selection, fork gotchas, and migration paths
steve-downey Aug 1, 2026
13ab693
Sync template with exemplar for CMake bump and README docs
steve-downey Aug 9, 2026
521d1ad
Template the two remaining hardcoded BEMAN_EXEMPLAR option names
steve-downey Aug 9, 2026
8bf7872
Add CMake 4.4.2 to the copier-cmake-matrix
steve-downey Aug 9, 2026
a76b301
Post generation task additions
steve-downey Aug 10, 2026
2dad670
Fix codespell typo in copier.yml task comment
steve-downey Sep 4, 2026
04396d7
Exercise the modules variant in the copier CMake matrix
steve-downey Sep 4, 2026
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
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
infra/** linguist-vendored
cookiecutter/** linguist-vendored
template/** linguist-vendored
copier/** linguist-vendored
*.bib -linguist-detectable
*.tex -linguist-detectable
papers/* linguist-documentation
12 changes: 6 additions & 6 deletions .github/workflows/catch2_exemplar_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
uses: actions/checkout@v6
- name: Test catch2 exemplar
run: |
cd cookiecutter
source ./check_cookiecutter.sh
cookiecutter_venv_path=$(mktemp --directory --dry-run)
setup_venv "$cookiecutter_venv_path"
stamp "$PWD" "./catch2_exemplar" "catch2" "true"
cd catch2_exemplar/exemplar
cd copier
source ./check_copier.sh
copier_venv_path=$(mktemp --directory --dry-run)
setup_venv "$copier_venv_path"
stamp "$repo_root" "./catch2_exemplar" "catch2" "true"
cd catch2_exemplar
cmake -B build -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./infra/cmake/use-fetch-content.cmake -DCMAKE_CXX_STANDARD=20 -DCMAKE_INSTALL_PREFIX=$PWD/dist
cmake --build build
ctest --test-dir build
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,61 @@ jobs:
beman-submodule-check:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.7.4

copier-test:
runs-on: ubuntu-latest
container:
image: ghcr.io/bemanproject/infra-containers-gcc:latest
steps:
- uses: actions/checkout@v4
- name: Install uv
shell: bash
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Test Copier Template Variants
shell: bash
env:
GITHUB_ACTIONS: true
# gcc-release will use GCC 15 which supports C++23 modules appropriately in this container
run: ./copier/test_standard_project.sh gcc-release

copier-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
shell: bash
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Generated project self-lints cleanly
shell: bash
# Verify a freshly generated standard project passes its own
# pre-commit config (gersemi, clang-format, beman-tidy) on the first
# run, exercising copier/format_project.sh.
run: ./copier/lint_standard_project.sh my_project

copier-cmake-matrix:
runs-on: ubuntu-latest
container:
image: ghcr.io/bemanproject/infra-containers-gcc:latest
strategy:
fail-fast: false
matrix:
cmake_version: ["3.30.9", "3.31.10", "4.0.3", "4.1.3", "4.2.3", "4.3.2", "4.4.2"]
steps:
- uses: actions/checkout@v4
- name: Install uv
shell: bash
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Test Copier Template Variants Matrix
shell: bash
env:
GITHUB_ACTIONS: true
# Run across our experimental boundaries
run: ./copier/test_cmake_matrix.sh gcc-release ${{ matrix.cmake_version }}
preset-test:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.7.4
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

name: Cookiecutter Test
name: Copier Test
on:
push:
branches:
- main
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
cookiecutter-test:
copier-test:
runs-on: ubuntu-latest
name: "Check cookiecutter for consistency"
name: "Check copier for consistency"
steps:
- name: Checkout
uses: actions/checkout@v6
- name: beman cookiecutter consistency check
- name: beman copier consistency check
run: |
./cookiecutter/check_cookiecutter.sh
./copier/check_copier.sh
12 changes: 6 additions & 6 deletions .github/workflows/todo_exemplar_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
uses: actions/checkout@v6
- name: Test static exemplar
run: |
cd cookiecutter
source ./check_cookiecutter.sh
cookiecutter_venv_path=$(mktemp --directory --dry-run)
setup_venv "$cookiecutter_venv_path"
stamp "$PWD" "./static_exemplar" "gtest" "false"
cd static_exemplar/exemplar
cd copier
source ./check_copier.sh
copier_venv_path=$(mktemp --directory --dry-run)
setup_venv "$copier_venv_path"
stamp "$repo_root" "./static_exemplar" "gtest" "false"
cd static_exemplar
grep -r 'identity' . && exit 1
find . -name '*identity*' | grep . && exit 1
cmake -B build -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./infra/cmake/use-fetch-content.cmake -DCMAKE_CXX_STANDARD=20 -DCMAKE_INSTALL_PREFIX=$PWD/dist
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ repos:
hooks:
- id: codespell

exclude: 'cookiecutter/|infra/|port/'
exclude: 'template/|copier/|infra/|port/'
41 changes: 41 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,47 @@ ctest --test-dir build
The file `./lockfile.json` configures the list of dependencies and versions that will be
acquired by FetchContent.

## Developing The Copier Template

This repository doubles as both the exemplar library and the Copier template used to stamp
new Beman libraries.

The template workflow is organized as follows:

* `copier.yml` defines the Copier questions, defaults, validation rules, and post-copy
tasks.
* `template/` contains the files rendered into generated projects.
* `stamp.sh` is the user-facing wrapper for stamping a forked exemplar repository into a
new project.
* `./copier/check_copier.sh` validates that exemplar regenerates cleanly and that a
non-exemplar project does not leak exemplar-specific names like `identity`.

When testing local template changes, do not render directly from the Git checkout. The
Copier helper scripts intentionally render from a temporary snapshot with `.git`, `build`,
and `.venv` excluded so that validation uses the current worktree contents.

Run the template checks with:

```shell
./copier/check_copier.sh
```

If you need to smoke-test generated projects manually, start from the same validated flow:

```shell
tmpdir=$(mktemp -d)
python3 -m venv "$tmpdir/venv"
"$tmpdir/venv/bin/python3" -m pip install copier
src=$(mktemp -d)
rsync -a --exclude .git --exclude build --exclude .venv ./ "$src/"
"$tmpdir/venv/bin/copier" copy --trust --defaults \
-d template_src_path=https://github.com/bemanproject/exemplar.git \
-d template_commit="$(git rev-parse HEAD)" \
"$src" "$tmpdir/project"
```

Then configure and build the generated project as usual.

## Project-specific configure arguments

Project-specific options are prefixed with `BEMAN_EXEMPLAR`.
Expand Down
Loading
Loading