Files
ConformalLabpp/.gitea/workflows/cpp-tests.yml
Tarik Moussa 048875c002
All checks were successful
C++ Tests / test-fast (pull_request) Successful in 1m59s
API Docs / doc-build (pull_request) Successful in 56s
C++ Tests / test-cgal (pull_request) Has been skipped
C++ Tests / quality-gates (pull_request) Successful in 1m56s
ci: disable test-cgal job (compute-intensive, OOM-prone)
The CGAL test build is too heavy for the eulernest runner — most recent
runs OOM during CGAL+Eigen template expansion at -j1/1600 MB rather than
exposing real regressions. Gate the job off with `if: false` and a
DISABLED-2026-05-26 comment block, matching the pattern already used for
doxygen-pages.yml and perf-compile-time.yml. test-fast and quality-gates
keep running on every push/PR; workflow_dispatch reruns of test-cgal
still work from the Gitea UI.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 22:19:11 +02:00

184 lines
8.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: C++ Tests
on:
push:
branches:
- main
- dev
- "claude/**"
- "feature/**"
pull_request:
# ─────────────────────────────────────────────────────────────────────────────
# Job 1 — test-fast
# Pure-math tests (Clausen, ImLi₂, Hyper-ideal geometry).
# No CGAL, no Boost. Eigen + GTest only. Runs on ALL branches.
# ─────────────────────────────────────────────────────────────────────────────
jobs:
test-fast:
runs-on: eulernest
container:
image: git.eulernest.eu/conformallab/ci-cpp:latest
steps:
- uses: actions/checkout@v4
- name: Configure (tests-only)
run: cmake -S code -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: nice -n 19 cmake --build build --target conformallab_tests -j$(nproc)
- name: Run tests
run: >
ctest --test-dir build
--output-on-failure
--output-junit test-results.xml
- name: Summary
if: always()
run: |
if [ -f test-results.xml ]; then
total=$(grep -o 'tests="[0-9]*"' test-results.xml | grep -o '[0-9]*' | head -1)
failed=$(grep -o 'failures="[0-9]*"' test-results.xml | grep -o '[0-9]*' | head -1)
skipped=$(grep -o 'skipped="[0-9]*"' test-results.xml | grep -o '[0-9]*' | head -1)
passed=$(( ${total:-0} - ${failed:-0} - ${skipped:-0} ))
echo "FAST ▸ TOTAL ${total:-0} | PASSED $passed | FAILED ${failed:-0} | SKIPPED ${skipped:-0}"
fi
# ─────────────────────────────────────────────────────────────────────────────
# Job 2 — test-cgal
# Full CGAL test suite (Phase 37, 158 tests).
# Runs ONLY on pull requests (not on direct pushes to dev/main).
# Starts only after test-fast succeeds.
#
# Uses -DWITH_CGAL_TESTS=ON (not -DWITH_CGAL=ON) to avoid building
# Viewer/GLFW — the CI container has no wayland-scanner.
#
# Boost (libboost-dev) is already present in the container since the image rebuild.
# ─────────────────────────────────────────────────────────────────────────────
# ─── DISABLED 2026-05-26 ──────────────────────────────────────────────────
# The full CGAL test build (`conformallab_cgal_tests`, -j1, ~minutes) is
# too compute-intensive for the eulernest runner: even with the 1600 MB
# memory bump the job OOMs intermittently during CGAL+Eigen template
# expansion, so most recent runs fail without exposing a real regression.
# While we work through this, the job is gated off via `if: false` —
# `workflow_dispatch` reruns from the Gitea UI still work, and the body
# of the job is preserved unchanged for easy reactivation.
#
# Consequences:
# * test-fast (Job 1) still runs on every push/PR — pure-math tests
# stay gated.
# * quality-gates (Job 3) still runs on every push/PR — style /
# convention checks stay gated.
# * The two structural sub-gates nested under test-cgal
# (`scripts/check-test-counts.sh`, `scripts/try_it.sh`) are
# temporarily un-gated. Run them locally before tagging a release;
# a follow-up will relocate them into a cheaper job.
#
# To re-enable: change `if: false` back to
# `if: github.event_name == 'pull_request'`.
test-cgal:
needs: test-fast
if: false # DISABLED 2026-05-26 — see comment block above
runs-on: eulernest
container:
image: git.eulernest.eu/conformallab/ci-cpp:latest
# Memory bumped from 1400m → 1600m to avoid OOM during CGAL header
# compilation on ARM64 (CGAL + Eigen templates allocate ~700 MB per
# cc1plus instance; -j1 leaves a small margin).
# memory-swap == memory disables swap entirely so OOM fails fast
# rather than thrashing on the SD card.
options: "--memory=1600m --memory-swap=1600m"
steps:
- uses: actions/checkout@v4
- name: Configure (WITH_CGAL_TESTS — no viewer, no wayland-scanner)
run: cmake -S code -B build -DWITH_CGAL_TESTS=ON -DCMAKE_BUILD_TYPE=Release
- name: Build CGAL-Tests
run: nice -n 19 cmake --build build --target conformallab_cgal_tests -j1
- name: Run CGAL-Tests
run: >
ctest --test-dir build
-R "^cgal\."
--output-on-failure
--output-junit cgal-results.xml
- name: Summary
if: always()
run: |
if [ -f cgal-results.xml ]; then
total=$(grep -o 'tests="[0-9]*"' cgal-results.xml | grep -o '[0-9]*' | head -1)
failed=$(grep -o 'failures="[0-9]*"' cgal-results.xml | grep -o '[0-9]*' | head -1)
skipped=$(grep -o 'skipped="[0-9]*"' cgal-results.xml | grep -o '[0-9]*' | head -1)
passed=$(( ${total:-0} - ${failed:-0} - ${skipped:-0} ))
echo "CGAL ▸ TOTAL ${total:-0} | PASSED $passed | FAILED ${failed:-0} | SKIPPED ${skipped:-0}"
fi
# ── Structural gate: doc/api/tests.md totals match ctest reality ───
# Single source of truth for test counts (see doc/release-policy.md).
# Reuses the already-built ./build dir via BUILD_DIR env var, so this
# adds ~5 s on top of the existing CGAL job.
- name: Verify test-count consistency (doc/api/tests.md)
run: BUILD_DIR=build bash scripts/check-test-counts.sh
# ── Structural gate: end-to-end smoke (try_it.sh) ──────────────────
# The user-facing quick-start script: configure + build + run the
# full ctest + run the Euclidean example on a bundled mesh. If
# this regresses, README quick-start instructions are broken.
# try_it.sh creates its own build-try/ — accept the ~3 min cost as
# the price of guaranteeing the documented workflow stays working.
- name: End-to-end smoke test (scripts/try_it.sh)
run: bash scripts/try_it.sh
# ─────────────────────────────────────────────────────────────────────────────
# Job 3 — quality-gates (style + convention block)
#
# Cheap, deterministic checks that should never break unless a contributor
# introduces a regression. Each gate is a script under scripts/quality/
# and exits 0 only when its tree is clean. These ran for weeks locally
# at zero findings before being promoted here.
#
# Tools installed at job-start (the ci-cpp image already has python3 +
# bash; we add codespell + shellcheck on top). Total wall-time: ~30 s
# on the eulernest runner.
#
# Strictly required for merges into main/dev — a regression fails the PR.
# ─────────────────────────────────────────────────────────────────────────────
quality-gates:
needs: test-fast
runs-on: eulernest
container:
image: git.eulernest.eu/conformallab/ci-cpp:latest
steps:
- uses: actions/checkout@v4
- name: Install codespell + shellcheck (job-local)
run: |
apt-get update -qq
apt-get install -y --no-install-recommends \
codespell shellcheck
- name: License headers (every C++ source carries MIT SPDX)
run: bash scripts/quality/license-headers.sh
- name: CGAL conventions (6 rules over CGAL public headers)
run: python3 scripts/quality/cgal-conventions.py
- name: codespell (docs + source comments + script messages)
run: bash scripts/quality/codespell.sh
- name: shellcheck (scripts/**/*.sh, severity=warning, strict)
run: bash scripts/quality/shellcheck.sh --strict
- name: Summary
if: always()
run: |
echo "QUALITY ▸ all four gates passed."
echo " see scripts/quality/README.md for the full catalogue"
echo " (sanitizers, clang-tidy, coverage, etc. are local-only)"