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
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ What happened? What did you expect?

## Steps to reproduce

1. …
2. …
3. …
1. ...
2. ...
3. ...

## Environment

Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- Brief description of the change -->

**Release notes:** Use a [Conventional Commits](https://www.conventionalcommits.org/)–style PR title (e.g. `feat: add X`, `fix: resolve Y`, `docs: update Z`) so [release-please](https://github.com/googleapis/release-please) can include this change in the changelog. If you squash-merge, use the PR title as the commit message.
**Release notes:** Use a [Conventional Commits](https://www.conventionalcommits.org/)-style PR title (e.g. `feat: add X`, `fix: resolve Y`, `docs: update Z`) so [release-please](https://github.com/googleapis/release-please) can include this change in the changelog. If you squash-merge, use the PR title as the commit message.

## Checklist

Expand Down
12 changes: 6 additions & 6 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Use this for every PR review in this repository: optimize for correctness, safet

## Review output format

- Start with a brief summary (1–3 bullets): what changed + biggest risks.
- Start with a brief summary (1-3 bullets): what changed + biggest risks.
- Then list issues grouped by severity:
- **BLOCKER** (must fix before merge)
- **MAJOR** (strongly recommended)
Expand Down Expand Up @@ -32,7 +32,7 @@ Use this for every PR review in this repository: optimize for correctness, safet
- Flag accidental O(N²) behavior, unnecessary allocations/copies, and hidden sync points.
- Recommend `const&`, move semantics, reserve, and `std::span` when it helps.
- Prefer algorithmic improvements over micro-optimizations.
- Avoid premature "clever" tricks—only optimize with a clear benefit.
- Avoid premature "clever" tricks - only optimize with a clear benefit.

### Concurrency

Expand Down Expand Up @@ -96,11 +96,11 @@ Apply this section when the PR changes files under `tests/` or `*_test.cpp`.
- If mocking: keep mocks minimal and verify behavior, not implementation details.
- Ensure tests run fast and don't require special hardware unless explicitly marked.

## This repository (VneTemplate)
## This repository (vnesc)

### Project layout
### Project layout (vertexnova/sc)

- Library: **src/vertexnova/template/** — Public API: **include/vertexnova/template/** — Tests: **tests/** — Examples: **examples/**
- Library: **src/vertexnova/sc/** - Public API: **include/vertexnova/sc/** - Tests: **tests/** - Examples: **examples/**
- Dependencies: **deps/internal/** (e.g. vnecommon, vnelogging), **deps/external/** (e.g. googletest). No top-level `external/` or `libs/`.

### Formatting and static analysis
Expand All @@ -115,7 +115,7 @@ Keep comments concrete: cite the guideline or rule and suggest a specific fix wh

## Checklist

- [ ] Summary (1–3 bullets) and issues grouped by BLOCKER / MAJOR / MINOR with file, reason, and fix.
- [ ] Summary (1-3 bullets) and issues grouped by BLOCKER / MAJOR / MINOR with file, reason, and fix.
- [ ] C++ focus areas considered (correctness, memory, perf, concurrency, errors, security, build, docs, CI).
- [ ] Naming/style and test rules (if PR touches tests) applied; violations cited with suggested fix.
- [ ] Repo layout and deps respected; no unnecessary deps edits.
Expand Down
22 changes: 7 additions & 15 deletions .github/workflows/build-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ jobs:
if: runner.os == 'Linux' && inputs.enable_coverage
run: sudo apt-get install -y lcov

# Coverage builds must start clean — cached Release objects lack
# Coverage builds must start clean - cached Release objects lack
# --coverage instrumentation and CMake will not recompile them.
- name: Clean build directory (coverage only)
if: inputs.enable_coverage
shell: bash
run: rm -rf ${{ env.BUILD_DIR }}

# ------------------------------------------------------------------
# Configure — use EFFECTIVE_BUILD_TYPE from previous step (single source of truth).
# Configure - use EFFECTIVE_BUILD_TYPE from previous step (single source of truth).
# ------------------------------------------------------------------
- name: Configure CMake
shell: bash
Expand All @@ -165,22 +165,14 @@ jobs:
COMPILER_FLAGS="-DCMAKE_C_COMPILER=$C_COMPILER -DCMAKE_CXX_COMPILER=$CPP_COMPILER"
fi

# Use validated CACHE_LIB_TYPE from previous step (empty/shared/static only).
LIB_TYPE_FLAGS=""
if [[ "$CACHE_LIB_TYPE" == "static" ]]; then
LIB_TYPE_FLAGS="-DVNE_TEMPLATE_LIB_TYPE=static"
else
LIB_TYPE_FLAGS="-DVNE_TEMPLATE_LIB_TYPE=shared"
fi

# shellcheck disable=SC2086 # intentional word-splitting for flag vars
# vnesc builds static archives; CACHE_LIB_TYPE only selects the build/ dir name.
cmake -B "$BUILD_DIR" -S . \
-DCMAKE_BUILD_TYPE="$EFFECTIVE_BUILD_TYPE" \
-DVNE_TEMPLATE_CI=ON \
-DVNE_SC_CI=ON \
-DWARNINGS_AS_ERRORS="$WAE" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
${COVERAGE_FLAG} \
${LIB_TYPE_FLAGS} \
${COMPILER_FLAGS} \
${EXTRA_FLAGS}

Expand All @@ -198,12 +190,12 @@ jobs:
GCNO_COUNT=$(find "$BUILD_DIR" -name "*.gcno" 2>/dev/null | wc -l)
echo "Total .gcno files: $GCNO_COUNT"
if [[ "$GCNO_COUNT" -eq 0 ]]; then
echo "::error::No .gcno files found — binary was not compiled with --coverage. Check ENABLE_COVERAGE and build type."
echo "::error::No .gcno files found - binary was not compiled with --coverage. Check ENABLE_COVERAGE and build type."
exit 1
fi

# ------------------------------------------------------------------
# Test — JUnit XML output for inline PR annotations
# Test - JUnit XML output for inline PR annotations
# Note: --output-junit requires CMake 3.21+; ubuntu-latest ships 3.22+
# ------------------------------------------------------------------
- name: Test
Expand All @@ -224,7 +216,7 @@ jobs:
GCDA_COUNT=$(find "$BUILD_DIR" -name "*.gcda" 2>/dev/null | wc -l)
echo "Total .gcda files: $GCDA_COUNT"
if [[ "$GCDA_COUNT" -eq 0 ]]; then
echo "::error::No .gcda files found after running tests — tests may not have executed or binary not linked with --coverage."
echo "::error::No .gcda files found after running tests - tests may not have executed or binary not linked with --coverage."
exit 1
fi

Expand Down
29 changes: 14 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
# Author: Ajeet Singh Yadav
# Created: February 2026
#
# Description: CI pipeline — staged, gated, with concurrency cancellation.
# Stage 1 — Pre-checks : clang-format (fail-fast gate), commit-lint (warning only)
# Stage 2+3 — Build+Test: Linux GCC/Clang/ASan, macOS, Windows (static libs only)
# Stage 4 — Analysis : clang-tidy (reuses Clang build cache)
# Stage 5 — CI Gate : single required status check for branch protection
# Branch protection: require only "CI Gate" — not individual job names.
# Description: CI pipeline - staged, gated, with concurrency cancellation.
# Stage 1 - Pre-checks : clang-format (fail-fast gate), commit-lint (warning only)
# Stage 2+3 - Build+Test: Linux GCC/Clang/ASan, macOS, Windows (static libs only)
# Stage 4 - Analysis : clang-tidy (reuses Clang build cache)
# Stage 5 - CI Gate : single required status check for branch protection
# Branch protection: require only "CI Gate" - not individual job names.
#
# Autodoc: yes
# ----------------------------------------------------------------------
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
# STAGE 0: DETECT RELEASE-PLEASE COMMITS
# Release-please merges only touch: CHANGELOG.md, VERSION,
# .release-please-manifest.json, release-please-config.json.
# Skip all builds for those commits — CI already ran on the source PR.
# Skip all builds for those commits - CI already ran on the source PR.
# ====================================================================

detect-release:
Expand All @@ -69,7 +69,7 @@ jobs:
if [[ "$EVENT" == "pull_request" ]]; then
if [[ "$HEAD_REF" == release-please--* ]]; then
IS_RELEASE=true
echo "Release-please PR detected (branch: $HEAD_REF) — skipping builds."
echo "Release-please PR detected (branch: $HEAD_REF) - skipping builds."
fi
fi

Expand All @@ -88,15 +88,15 @@ jobs:

if [[ "$ACTOR_MATCH" == "true" && -z "$NON_RELEASE" && -n "$CHANGED" ]]; then
IS_RELEASE=true
echo "Release-please merge detected (actor: $ACTOR, files: $CHANGED) — skipping builds."
echo "Release-please merge detected (actor: $ACTOR, files: $CHANGED) - skipping builds."
fi
fi

echo "is_release=$IS_RELEASE" >> "$GITHUB_OUTPUT"

# ====================================================================
# STAGE 1: PRE-CHECKS (fail-fast gate)
# These jobs do NOT clone submodules — they only need source files.
# These jobs do NOT clone submodules - they only need source files.
# If any pre-check fails the gate blocks all downstream builds.
# ====================================================================

Expand All @@ -108,7 +108,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: false # clang-format only reads src/ include/ — no deps needed
submodules: false # clang-format only reads src/ include/ - no deps needed

- name: Install clang-format-17
# Pin to 17: the .clang-format file uses options removed in clang-format 18+
Expand All @@ -131,7 +131,7 @@ jobs:
name: "Pre-checks / commit messages"
runs-on: ubuntu-latest
# Only validate on PRs. Push-to-main arrives as release-please merge
# commits (chore(main): release X.Y.Z) which are always valid — and
# commits (chore(main): release X.Y.Z) which are always valid - and
# validating every commit in a merge-commit ancestry is fragile.
if: github.event_name == 'pull_request'
permissions:
Expand Down Expand Up @@ -317,8 +317,7 @@ jobs:
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DVNE_TEMPLATE_CI=ON \
-DVNE_TEMPLATE_LIB_TYPE=static \
-DVNE_SC_CI=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake --build build/static --config Release --parallel
fi
Expand All @@ -337,7 +336,7 @@ jobs:
# ====================================================================
# STAGE 5: CI GATE
# Single required status check. Branch protection should require only
# this job — not the individual build job names. This ensures the
# this job - not the individual build job names. This ensures the
# required check name stays stable even as build jobs are renamed.
# ====================================================================

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ jobs:
run: |
cmake -B build/static -S . \
-DCMAKE_BUILD_TYPE=Release \
-DVNE_TEMPLATE_CI=ON \
-DVNE_TEMPLATE_LIB_TYPE=static \
-DVNE_SC_CI=ON \
-DWARNINGS_AS_ERRORS=OFF
cmake --build build/static --config Release --parallel

Expand Down
51 changes: 37 additions & 14 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
# When the Release PR is merged, publishes pre-built Release binary artifacts
# for all supported platforms to the GitHub Release.
# Two-tier release model:
# Tier 1 — source consumers: pin the release tag as a git submodule.
# Tier 2 — binary consumers: download .tar.gz from GitHub Releases.
# Tier 1 - source consumers: pin the release tag as a git submodule.
# Tier 2 - binary consumers: download .tar.gz from GitHub Releases.
# Repo Settings required (one-time):
# Settings → General → Pull Requests → "Allow auto-merge" — ON
# Settings -> General -> Pull Requests -> "Allow auto-merge" - ON
# REPO_ACCESS_TOKEN (optional): use for higher limits; else github.token is used.
#
# Autodoc: yes
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
token: ${{ secrets.REPO_ACCESS_TOKEN || github.token }}

# Enable auto-merge so the Release PR merges once CI Gate passes. If the repo
# has not enabled "Allow auto-merge" (Settings → General, and Branches → main),
# has not enabled "Allow auto-merge" (Settings -> General, and Branches -> main),
# we warn and leave the PR open for manual merge instead of failing the workflow.
- name: Enable auto-merge on Release PR
if: steps.rp.outputs.pr != ''
Expand All @@ -64,22 +64,22 @@ jobs:
PR_NUMBER="$(echo "$PR_RAW" | python3 -c 'import sys,json; print(json.load(sys.stdin)["number"])')"
if ! gh pr merge --repo "${{ github.repository }}" --auto --squash "$PR_NUMBER" 2>&1 | tee /tmp/gh-out; then
if grep -q "enablePullRequestAutoMerge\|Auto merge is not allowed" /tmp/gh-out; then
echo "::warning::Auto-merge is disabled for this repo. Enable it under Settings → General → Pull Requests → 'Allow auto-merge'. Release PR #$PR_NUMBER remains open for manual merge."
echo "::warning::Auto-merge is disabled for this repo. Enable it under Settings -> General -> Pull Requests -> 'Allow auto-merge'. Release PR #$PR_NUMBER remains open for manual merge."
exit 0
fi
exit 1
fi

# --------------------------------------------------------------------
# Stage 2: Build and publish artifacts (only when a release was created this run).
# Skipped on most pushes — release_created is true only when the Release PR
# Skipped on most pushes - release_created is true only when the Release PR
# was merged in this run (release-please then creates the tag + GitHub Release).
#
# Produces 3 tarballs per release (Release build only):
# vnetemplate-vX.Y.Z-{platform}.tar.gz
# vnesc-vX.Y.Z-{platform}.tar.gz
#
# Contents: one library per build in lib/ (static or shared via VNE_TEMPLATE_LIB_TYPE;
# e.g. libvnetemplate.so or libvnetemplate.a on Unix), include/vertexnova/template/
# Contents: static libs under lib/ (libvnesc.a, libvnesc_spirvcross.a, ...),
# include/vertexnova/sc/, and CLI tools under bin/ when built.
# --------------------------------------------------------------------
publish:
name: "Release / publish (${{ matrix.platform }})"
Expand Down Expand Up @@ -128,10 +128,12 @@ jobs:
if [[ -n "${{ matrix.c }}" ]]; then
COMPILER_FLAGS="-DCMAKE_C_COMPILER=${{ matrix.c }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp }}"
fi
# shellcheck disable=SC2086
cmake -B build/static -S . \
-DCMAKE_BUILD_TYPE=Release \
-DVNE_TEMPLATE_CI=ON \
-DVNE_TEMPLATE_LIB_TYPE=static \
-DVNE_SC_TESTS=OFF \
-DVNE_SC_EXAMPLES=OFF \
-DVNE_SC_TOOLS=ON \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install" \
$COMPILER_FLAGS

Expand All @@ -141,16 +143,37 @@ jobs:

- name: Install to staging directory
shell: bash
run: cmake --install build/static --config Release --component vnetemplate
run: |
# Install library + headers (vnesc) and CLI tools (vnesc_tools).
cmake --install build/static --config Release --component vnesc
cmake --install build/static --config Release --component vnesc_tools

- name: Verify install layout
shell: bash
run: |
PREFIX="${{ github.workspace }}/install"
if [[ ! -d "$PREFIX/include/vertexnova/sc" ]]; then
echo "::error::Expected $PREFIX/include/vertexnova/sc missing after cmake --install."
ls -la "$PREFIX" || true
exit 1
fi
if [[ ! -d "$PREFIX/lib" ]] && [[ ! -d "$PREFIX/lib64" ]]; then
echo "::error::Expected lib/ or lib64/ under $PREFIX missing."
ls -laR "$PREFIX" || true
exit 1
fi
echo "Install layout OK:"
find "$PREFIX" -maxdepth 3 -type f | head -40

- name: Package artifact
shell: bash
run: |
ARTIFACT="vnetemplate-v${{ needs.release-please.outputs.version }}-${{ matrix.platform }}.tar.gz"
ARTIFACT="vnesc-v${{ needs.release-please.outputs.version }}-${{ matrix.platform }}.tar.gz"
# -C changes into the install dir so tar sees only its contents (no path prefix).
# The output path is relative to CWD (repo root) — avoids Windows drive-letter issues.
# The output path is relative to CWD (repo root) - avoids Windows drive-letter issues.
tar -czf "${ARTIFACT}" -C "${{ github.workspace }}/install" .
echo "ARTIFACT=${ARTIFACT}" >> "$GITHUB_ENV"
echo "Published: ${ARTIFACT}"

- name: Upload to GitHub Release
uses: softprops/action-gh-release@v2
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Pre-commit hooks for VneTemplate
# Pre-commit hooks for vnesc
# Install: pip install pre-commit && pre-commit install
# Run manually: pre-commit run --all-files

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Bug Fixes

* fixing CI skipping issue while merging to main ([#15](https://github.com/vertexnova/vnetemplate/issues/15)) ([4f60e3e](https://github.com/vertexnova/vnetemplate/commit/4f60e3eec70bc6b2b9b926887c9ec3d447a6b394))
* improve auto-merge handling for Release PRs to support special c… ([#17](https://github.com/vertexnova/vnetemplate/issues/17)) ([6c08f5d](https://github.com/vertexnova/vnetemplate/commit/6c08f5d92d205bc13beceb529342bec24fb4ac45))
* improve auto-merge handling for Release PRs to support special c... ([#17](https://github.com/vertexnova/vnetemplate/issues/17)) ([6c08f5d](https://github.com/vertexnova/vnetemplate/commit/6c08f5d92d205bc13beceb529342bec24fb4ac45))

## [0.1.1](https://github.com/vertexnova/vnetemplate/compare/v0.1.0...v0.1.1) (2026-02-20)

Expand Down
Loading
Loading