Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
827b9d5
Add a continuous integration workflow for the Chrono-free build on Li…
dav-og Dec 1, 2026
4ae7335
Build Chrono in continuous integration and run the unit and regressio…
dav-og Dec 1, 2026
548b1aa
Run the full test suites nightly and on request in continuous integra…
dav-og Dec 1, 2026
3b0727a
Add macOS jobs to continuous integration.
dav-og Dec 1, 2026
5b2aa4c
Install Chrono with absolute library install names on macOS.
dav-og Dec 2, 2026
5ce448d
Give the external-PTO RM3 regression test the regression time limit.
dav-og Dec 2, 2026
ab0bd78
Fix build.ps1 failing after a clean Chrono-free build.
dav-og Dec 2, 2026
cfb9751
Add a -Junit option to the Windows test runner scripts.
dav-og Dec 2, 2026
1a9d275
Add a Chrono build script for Windows and an HDF5 target shim.
dav-og Dec 2, 2026
a9a5253
Add Windows jobs to continuous integration.
dav-og Dec 2, 2026
9bdd32e
Do not fail the Windows job when the Chrono work folder cannot be rem…
dav-og Dec 2, 2026
ef6ae96
Point the Windows Chrono build at the vcpkg tree so that HDF5 finds Z…
dav-og Dec 2, 2026
66e62f9
Fix run_unit_tests.ps1 failing to parse under PowerShell 7.
dav-og Dec 2, 2026
7f66ffe
Stage the remaining vcpkg runtime DLLs for the Windows tests in conti…
dav-og Dec 2, 2026
faafcf4
Stage and install vcpkg's zlib DLL under its newer name, libz.dll.
dav-og Dec 2, 2026
70064f3
Check the staged vcpkg DLLs instead of copying them in continuous int…
dav-og Dec 2, 2026
03649f9
Describe continuous integration in the contributing guide and the tes…
dav-og Dec 2, 2026
3376d96
Add a single All checks job for branch protection.
dav-og Dec 2, 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
842 changes: 842 additions & 0 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -838,12 +838,14 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
endif()
endif()
endforeach()
# vcpkg-style HDF5: zlib1.dll / szip.dll sit next to hdf5.dll but are not
# vcpkg-style HDF5: the zlib and szip DLLs sit next to hdf5.dll but are not
# separate imported targets; install them so staged installs and CPack run.
# vcpkg's zlib DLL is zlib1.dll in older releases and libz.dll in newer ones;
# only the files that exist are installed.
get_target_property(_hdf5_main_dll hdf5::hdf5-shared IMPORTED_LOCATION_RELEASE)
if(_hdf5_main_dll AND EXISTS "${_hdf5_main_dll}")
get_filename_component(_hdf5_peer_dir "${_hdf5_main_dll}" DIRECTORY)
foreach(_hdf5_peer_dll IN ITEMS zlib1.dll szip.dll)
foreach(_hdf5_peer_dll IN ITEMS zlib1.dll libz.dll szip.dll)
set(_hdf5_peer "${_hdf5_peer_dir}/${_hdf5_peer_dll}")
if(EXISTS "${_hdf5_peer}")
install(FILES "${_hdf5_peer}" DESTINATION bin COMPONENT runtime)
Expand Down
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,20 @@ See [tests/README.md](tests/README.md) for suite overview and how to run tests.
For per-case tables and CI-style `ctest` usage, see
[tests/TEST_SUITES_REFERENCE.md](tests/TEST_SUITES_REFERENCE.md).

### Continuous integration

Every pull request is built and tested on Linux, macOS and Windows by GitHub
Actions ([`.github/workflows/ci.yml`](.github/workflows/ci.yml)). The jobs run
the same build and test scripts as a local build, so a failure can be
reproduced with the commands shown in the job log. What runs, and when, is
described in [tests/README.md](tests/README.md#continuous-integration).

- A run fails if a test fails **or is skipped**.
- Add the label **`full-tests`** to a pull request to also run the
verification, comparison and long regression suites before merging.
- If a test fails on one platform only, report it in the pull request. Do not
regenerate reference data or widen a tolerance to make the run pass.


## License

Expand Down
25 changes: 25 additions & 0 deletions cmake/ChronoHdf5ToolsShim.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# HDF5 "tools" target shim for building Project Chrono 10.0.0 (not used by the
# SEA-Stack build itself).
#
# Chrono links hdf5::hdf5_tools-shared (or -static) whenever the HDF5 package
# config provides hdf5::hdf5-shared (or -static). Some HDF5 packages, vcpkg's
# among them, do not export the tools target, and the Chrono configure then
# stops with "target hdf5::hdf5_tools-shared was not found".
#
# Pass this file to the Chrono configure so that it runs right after project():
# -DCMAKE_PROJECT_INCLUDE=<sea-stack>/cmake/ChronoHdf5ToolsShim.cmake
# scripts/windows/build_chrono.ps1 does this. It defines the missing target as
# an interface to the main HDF5 library; targets that exist are left untouched.

find_package(hdf5 CONFIG QUIET)

foreach(_seastack_hdf5_kind shared static)
if(TARGET hdf5::hdf5-${_seastack_hdf5_kind}
AND NOT TARGET hdf5::hdf5_tools-${_seastack_hdf5_kind})
add_library(hdf5::hdf5_tools-${_seastack_hdf5_kind} INTERFACE IMPORTED GLOBAL)
set_target_properties(hdf5::hdf5_tools-${_seastack_hdf5_kind} PROPERTIES
INTERFACE_LINK_LIBRARIES hdf5::hdf5-${_seastack_hdf5_kind})
message(STATUS "ChronoHdf5ToolsShim: defined hdf5::hdf5_tools-${_seastack_hdf5_kind}")
endif()
endforeach()
unset(_seastack_hdf5_kind)
39 changes: 37 additions & 2 deletions docs/build/BUILD_CHRONO.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,24 @@ SEA-Stack’s `build-config.example.json` uses an **install** prefix path such a

## Windows example (Visual Studio + vcpkg HDF5 / Eigen)

Prerequisites (see [BUILD_WINDOWS.md](BUILD_WINDOWS.md)): Visual Studio C++ workload, CMake, and vcpkg packages such as `hdf5[cpp]:x64-windows` and Eigen if not supplied elsewhere.
Prerequisites (see [BUILD_WINDOWS.md](BUILD_WINDOWS.md)): Visual Studio C++ workload, CMake, and vcpkg packages such as `hdf5[cpp,hl]:x64-windows` and `eigen3:x64-windows` if not supplied elsewhere. Chrono links the HDF5 high-level libraries, so the `hl` feature is needed as well as `cpp`.

Configure Chrono (adjust paths):
[`scripts/windows/build_chrono.ps1`](../../scripts/windows/build_chrono.ps1) runs the recipe below for the pinned `10.0.0` tag from a Visual Studio x64 developer shell:

```powershell
.\scripts\windows\build_chrono.ps1 -Prefix C:/path/to/chrono-install -VcpkgRoot C:/path/to/vcpkg
```

It also turns off the optional Python parser (`CMAKE_DISABLE_FIND_PACKAGE_Python3=ON`), so no Chrono library links Python. The continuous integration workflow builds Chrono with the same script.

To configure Chrono by hand (adjust paths):

```powershell
cmake -S C:/path/to/chrono-src -B C:/path/to/chrono-build `
-G "Visual Studio 17 2022" -A x64 `
-DCMAKE_INSTALL_PREFIX=C:/path/to/chrono-install `
-DCMAKE_TOOLCHAIN_FILE=C:/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake `
-DCMAKE_PROJECT_INCLUDE=C:/path/to/sea-stack/cmake/ChronoHdf5ToolsShim.cmake `
-DBUILD_SHARED_LIBS=ON `
-DCH_ENABLE_MODULE_PARSERS=ON `
-DCH_ENABLE_HDF5=ON `
Expand All @@ -88,6 +97,8 @@ Then in `build-config.json`:
"ChronoDir": "C:/path/to/chrono-install/cmake"
```

**`CMAKE_PROJECT_INCLUDE`** is needed with vcpkg's HDF5: Chrono 10.0.0 links a target named `hdf5::hdf5_tools-shared`, which that package does not export, and the configure otherwise stops with *"target was not found"*. [`cmake/ChronoHdf5ToolsShim.cmake`](../../cmake/ChronoHdf5ToolsShim.cmake) defines the missing target and leaves existing targets untouched.

If you do **not** use the vcpkg toolchain when configuring Chrono, you must still ensure **HDF5**, **ZLIB**, and other transitive dependencies are discoverable (e.g. `CMAKE_PREFIX_PATH` pointing at `vcpkg/installed/x64-windows`). Using **`CMAKE_TOOLCHAIN_FILE`** is the most reproducible approach on Windows.

---
Expand Down Expand Up @@ -134,6 +145,18 @@ cmake --build /path/to/chrono-build --parallel
cmake --install /path/to/chrono-build
```

[`scripts/unix/build_chrono.sh`](../../scripts/unix/build_chrono.sh) runs this
recipe for the pinned `10.0.0` tag and checks the result:

```bash
./scripts/unix/build_chrono.sh --prefix /path/to/chrono-install # headless
./scripts/unix/build_chrono.sh --prefix /path/to/chrono-install --vsg --prefix-path /path/to/vsg-install
```

It also turns off the optional Python parser
(`CMAKE_DISABLE_FIND_PACKAGE_Python3=ON`), so no Chrono library links Python.
The continuous integration workflow builds Chrono with the same script.

Notes:

- **`CH_USE_SIMD=OFF`** is what keeps `-march=native` out of Chrono objects and
Expand Down Expand Up @@ -185,6 +208,18 @@ If you will build a redistributable macOS ZIP (`--package`), add these two optio
- **`CMAKE_DISABLE_FIND_PACKAGE_Python3=ON`**: Chrono's Parsers module auto-detects Python and, if found, links `libChrono_parsers` against it (on the release build Mac it found the Command Line Tools Python 3.9). SEA-Stack only uses the YAML parser, but that link would make the package require the build machine's Python install. With this option `CHRONO_HAS_PYTHON` is undefined in `ChConfigParsers.h`, and no Chrono library links Python.
- **`CH_USE_EIGEN_OPENMP=OFF`**: the macOS v1.0.0 Chrono libraries were built with Eigen's internal OpenMP parallelism off (`EIGEN_DONT_PARALLELIZE`), as in the earlier release candidates. Keep it off so the package matches the tested build.

`scripts/unix/build_chrono.sh` applies both options on macOS. With Homebrew, pass the locations of the keg-only Eigen 3 and libomp, and of HDF5:

```bash
export CMAKE_PREFIX_PATH="$(brew --prefix eigen@3):$(brew --prefix hdf5):$(brew --prefix libomp)"
./scripts/unix/build_chrono.sh --prefix /path/to/chrono-install -- \
"-DEIGEN3_INCLUDE_DIR=$(brew --prefix eigen@3)/include/eigen3" \
"-DHDF5_DIR=$(brew --prefix hdf5)/lib/cmake/hdf5" \
"-DOpenMP_ROOT=$(brew --prefix libomp)"
```

The script also sets `CMAKE_INSTALL_NAME_DIR` to the `lib` folder of the install prefix. Chrono 10.0.0 otherwise installs its libraries with a bare file name as install name, and a program linked against the installation stops with *"dyld: Library not loaded: libChrono_core.dylib"*. A Chrono build tree does not have this problem.

Use a separate Chrono build directory for this configuration and point `ChronoDir` at it. The SEA-Stack packaging step aborts if any bundled library still references a path outside the package.

---
Expand Down
1 change: 1 addition & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
|----------|-----|
| [`unix/`](unix/) | Bash drivers for **macOS and Linux** (build, CTest wrappers, demo smoke). |
| [`windows/`](windows/) | **PowerShell** equivalents for Windows. |
| [`ci/`](ci/) | Helpers for the continuous integration workflows in `.github/workflows/`. |
| Repo root of `scripts/` | Cross-platform **Python** helpers (`seastack_build_prepare.py`, `validate_campaign_schema.py`). |

From the **sea-stack** repository root:
Expand Down
136 changes: 136 additions & 0 deletions scripts/ci/check_ctest_junit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
#!/usr/bin/env python3
"""Check a CTest JUnit report: every registered test must have run and passed.

Usage:
python3 scripts/ci/check_ctest_junit.py <report.xml> [--summary FILE] [--slowest N]

Write the report with `ctest --output-junit <report.xml>`.

CTest exits with 0 when a test is skipped, for example when a Python test
returns its SKIP_RETURN_CODE because a package is missing. On a continuous
integration runner every dependency is expected to be installed, so a skipped
test means that the run did not check what it claims to check. This script
fails when:
- the report contains no tests;
- a test failed;
- a test was skipped, disabled or not run.

--summary appends a Markdown summary to FILE (for example the file named by
GITHUB_STEP_SUMMARY). --slowest sets how many of the slowest tests are listed
(default 10).

Exit code 0 = pass, 1 = fail, 2 = usage error or unreadable report.
Standard library only.
"""
from __future__ import annotations

import argparse
import sys
import xml.etree.ElementTree as ET
from pathlib import Path
from typing import NamedTuple


class TestResult(NamedTuple):
name: str
outcome: str # "passed", "failed" or "not run"
detail: str
seconds: float


def classify(case: ET.Element) -> TestResult:
"""Map one <testcase> element to passed / failed / not run."""
name = case.get("name", "<unnamed>")
status = case.get("status", "")
try:
seconds = float(case.get("time", "0") or 0.0)
except ValueError:
seconds = 0.0

failure = case.find("failure")
if failure is None:
failure = case.find("error")
skipped = case.find("skipped")

if status == "run" and failure is None and skipped is None:
return TestResult(name, "passed", "", seconds)
if status == "fail" or failure is not None:
message = failure.get("message", "") if failure is not None else ""
return TestResult(name, "failed", message, seconds)
message = skipped.get("message", "") if skipped is not None else ""
return TestResult(name, "not run", message or f"status={status or 'missing'}", seconds)


def read_results(report: Path) -> list[TestResult]:
root = ET.parse(report).getroot()
return [classify(case) for case in root.iter("testcase")]


def markdown_summary(title: str, results: list[TestResult], slowest: int) -> str:
passed = sum(r.outcome == "passed" for r in results)
failed = [r for r in results if r.outcome == "failed"]
not_run = [r for r in results if r.outcome == "not run"]
total_seconds = sum(r.seconds for r in results)

lines = [
f"### {title}",
"",
"| Tests | Passed | Failed | Skipped or not run | Summed test time |",
"|------:|-------:|-------:|-------------------:|-----------------:|",
f"| {len(results)} | {passed} | {len(failed)} | {len(not_run)} | {total_seconds:.1f} s |",
"",
]
problems = failed + not_run
if problems:
lines += ["| Test | Outcome | Detail |", "|------|---------|--------|"]
lines += [f"| `{r.name}` | {r.outcome} | {r.detail} |" for r in problems]
lines.append("")
if slowest > 0 and results:
ranked = sorted(results, key=lambda r: r.seconds, reverse=True)[:slowest]
lines += ["| Slowest tests | Time |", "|---------------|-----:|"]
lines += [f"| `{r.name}` | {r.seconds:.1f} s |" for r in ranked]
lines.append("")
return "\n".join(lines) + "\n"


def main() -> int:
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
parser.add_argument("report", type=Path, help="JUnit XML written by ctest --output-junit")
parser.add_argument("--summary", type=Path, help="append a Markdown summary to this file")
parser.add_argument("--slowest", type=int, default=10, help="number of slowest tests to list")
args = parser.parse_args()

if not args.report.is_file():
print(f"[FAIL] JUnit report not found: {args.report}", file=sys.stderr)
return 2
try:
results = read_results(args.report)
except ET.ParseError as error:
print(f"[FAIL] cannot parse {args.report}: {error}", file=sys.stderr)
return 2

summary = markdown_summary(f"CTest results: {args.report.stem}", results, args.slowest)
if args.summary is not None:
with args.summary.open("a", encoding="utf-8") as handle:
handle.write(summary)

failed = [r for r in results if r.outcome == "failed"]
not_run = [r for r in results if r.outcome == "not run"]
passed = len(results) - len(failed) - len(not_run)
print(f"{args.report}: {len(results)} tests, {passed} passed, "
f"{len(failed)} failed, {len(not_run)} skipped or not run")
for result in failed + not_run:
print(f" [{result.outcome}] {result.name}: {result.detail}")

if not results:
print("[FAIL] the report contains no tests", file=sys.stderr)
return 1
if failed or not_run:
print("[FAIL] every registered test must run and pass", file=sys.stderr)
return 1
print("[OK] every registered test ran and passed")
return 0


if __name__ == "__main__":
raise SystemExit(main())
Loading
Loading