-j$(nproc) during CGAL+Eigen template compilation consumed ~1.5-2 GB peak RAM on the Raspberry Pi CI runner, starving the Gitea web server. Changes: - CGAL build: -j$(nproc) → -j2 (halves peak memory, ~700 MB per process) - Both builds: nice -n 19 (lowest CPU priority, web server keeps preemption) - test-cgal container: hard memory cap --memory=1400m --memory-swap=1400m so the container is OOM-killed rather than taking down the whole system Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
97 lines
4.1 KiB
YAML
97 lines
4.1 KiB
YAML
name: C++ Tests
|
||
|
||
on:
|
||
push:
|
||
branches:
|
||
- main
|
||
- dev
|
||
- "claude/**"
|
||
- "feature/**"
|
||
pull_request:
|
||
|
||
# ─────────────────────────────────────────────────────────────────────────────
|
||
# Job 1 — test-fast
|
||
# Pure-math tests (Clausen, ImLi₂, Hyper-ideal Geometrie).
|
||
# Kein CGAL, kein Boost. Nur Eigen + GTest. Läuft auf ALLEN 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: Zusammenfassung
|
||
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
|
||
# Vollständige CGAL-Test-Suite (Phase 3–7, 158 Tests).
|
||
# Läuft nur auf main, dev und Pull Requests — nicht auf Feature-Branches.
|
||
# Startet erst nach erfolgreichem test-fast.
|
||
#
|
||
# Verwendet -DWITH_CGAL_TESTS=ON (nicht -DWITH_CGAL=ON), damit kein
|
||
# Viewer/GLFW gebaut wird — der CI-Container hat kein wayland-scanner.
|
||
#
|
||
# Boost (libboost-dev) ist seit Image-Rebuild bereits im Container.
|
||
# ─────────────────────────────────────────────────────────────────────────────
|
||
test-cgal:
|
||
needs: test-fast
|
||
if: >
|
||
github.ref == 'refs/heads/main' ||
|
||
github.ref == 'refs/heads/dev' ||
|
||
github.event_name == 'pull_request'
|
||
runs-on: eulernest
|
||
container:
|
||
image: git.eulernest.eu/conformallab/ci-cpp:latest
|
||
options: "--memory=1400m --memory-swap=1400m"
|
||
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- name: Configure (WITH_CGAL_TESTS — kein Viewer, kein 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 -j2
|
||
|
||
- name: Run CGAL-Tests
|
||
run: >
|
||
ctest --test-dir build
|
||
-R "^cgal\."
|
||
--output-on-failure
|
||
--output-junit cgal-results.xml
|
||
|
||
- name: Zusammenfassung
|
||
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
|