From 34b6017f91f5e5d89be8584376b62e7c467035bc Mon Sep 17 00:00:00 2001 From: Jose Luis Cercos-Pita Date: Tue, 18 Nov 2025 06:41:19 +0100 Subject: [PATCH 1/7] feat(ci): Upgrade to Windows-latest --- .github/workflows/build-test.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 270af037..dd424023 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -71,7 +71,7 @@ jobs: needs: [create_release] strategy: matrix: - os: [ubuntu-22.04, windows-2022] + os: [ubuntu-22.04, windows-latest] steps: - uses: actions/checkout@v5 @@ -92,6 +92,16 @@ jobs: compiler: gcc if: runner.os == 'Linux' + - name: Setup NSIS (Windows) + run: | + iwr -useb get.scoop.sh -outfile 'install.ps1' + .\install.ps1 -RunAsAdmin + scoop update + scoop bucket add extras + scoop install nsis + Add-Content $env:GITHUB_PATH "C:\Users\runneradmin\scoop\shims\" + if: runner.os == 'Windows' + - name: Install VTK (Linux) run: | sudo apt-get -qq update From 2037995d53946f6c998ff865041b2c98272b2f4d Mon Sep 17 00:00:00 2001 From: Jose Luis Cercos-Pita Date: Tue, 18 Nov 2025 06:51:21 +0100 Subject: [PATCH 2/7] feat(ci): Upgrade to Ubuntu-latest --- .github/workflows/build-test.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index dd424023..d7b0f8c8 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -71,7 +71,7 @@ jobs: needs: [create_release] strategy: matrix: - os: [ubuntu-22.04, windows-latest] + os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v5 @@ -102,6 +102,12 @@ jobs: Add-Content $env:GITHUB_PATH "C:\Users\runneradmin\scoop\shims\" if: runner.os == 'Windows' + - name: Install Rust-bindgen (Linux) + run: | + sudo apt-get -qq update + sudo apt-get -qq -y install bindgen + if: runner.os == 'Linux' + - name: Install VTK (Linux) run: | sudo apt-get -qq update From ed45124dadc9e12ff2469c1645359ec0481057dc Mon Sep 17 00:00:00 2001 From: Jose Luis Cercos-Pita Date: Tue, 18 Nov 2025 06:56:35 +0100 Subject: [PATCH 3/7] feat(ci): Added to MacOS-latest --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index d7b0f8c8..481d197c 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -71,7 +71,7 @@ jobs: needs: [create_release] strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v5 From 49e79b40d72615ac7229ae6fb792660d34b68e8a Mon Sep 17 00:00:00 2001 From: Jose Luis Cercos-Pita Date: Tue, 18 Nov 2025 07:02:49 +0100 Subject: [PATCH 4/7] fix(ci): Set ubuntu-latest on all pipelines --- .github/workflows/mdf_verification.yml | 2 +- .github/workflows/memcheck.yml | 2 +- .github/workflows/python-wheels-emulated.yml | 2 +- .github/workflows/python-wheels-test.yml | 2 +- .github/workflows/python-wheels.yml | 2 +- .github/workflows/python-wrapper.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/mdf_verification.yml b/.github/workflows/mdf_verification.yml index 02b015f7..fa74cbaa 100644 --- a/.github/workflows/mdf_verification.yml +++ b/.github/workflows/mdf_verification.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04] + os: [ubuntu-latest] steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/memcheck.yml b/.github/workflows/memcheck.yml index a08ee6c9..750fe6b2 100644 --- a/.github/workflows/memcheck.yml +++ b/.github/workflows/memcheck.yml @@ -16,7 +16,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04] + os: [ubuntu-latest] steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/python-wheels-emulated.yml b/.github/workflows/python-wheels-emulated.yml index 1e3f8b8f..ed0d3d41 100644 --- a/.github/workflows/python-wheels-emulated.yml +++ b/.github/workflows/python-wheels-emulated.yml @@ -7,7 +7,7 @@ on: description: 'Host OS' required: false type: string - default: '["ubuntu-22.04"]' + default: '["ubuntu-latest"]' arch: description: 'Architecture target' required: true diff --git a/.github/workflows/python-wheels-test.yml b/.github/workflows/python-wheels-test.yml index e8fea72b..b6393946 100644 --- a/.github/workflows/python-wheels-test.yml +++ b/.github/workflows/python-wheels-test.yml @@ -7,7 +7,7 @@ on: description: 'Host OS' required: false type: string - default: '["ubuntu-22.04"]' + default: '["ubuntu-latest"]' arch: description: 'Architecture target' required: true diff --git a/.github/workflows/python-wheels.yml b/.github/workflows/python-wheels.yml index 5bfaa6c0..9596085f 100644 --- a/.github/workflows/python-wheels.yml +++ b/.github/workflows/python-wheels.yml @@ -46,7 +46,7 @@ jobs: name: Build Linux_x86_64 uses: FloatingArrayDesign/MoorDyn/.github/workflows/python-wheels-emulated.yml@master with: - os: '["ubuntu-22.04"]' + os: '["ubuntu-latest"]' arch: "x86_64" secrets: inherit diff --git a/.github/workflows/python-wrapper.yml b/.github/workflows/python-wrapper.yml index 84233a22..60c59672 100644 --- a/.github/workflows/python-wrapper.yml +++ b/.github/workflows/python-wrapper.yml @@ -21,7 +21,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04] + os: [ubuntu-latest] steps: - uses: actions/checkout@v5 From d3756e7adae9acbcee0862f2dc5e23f46ff0d06b Mon Sep 17 00:00:00 2001 From: Jose Luis Cercos-Pita Date: Tue, 18 Nov 2025 07:08:48 +0100 Subject: [PATCH 5/7] fix(ci): Install MoorDynF Blas and Lapack deps --- .github/workflows/mdf_verification.yml | 6 ++++++ tests/math_tests.cpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/mdf_verification.yml b/.github/workflows/mdf_verification.yml index fa74cbaa..431a5fcd 100644 --- a/.github/workflows/mdf_verification.yml +++ b/.github/workflows/mdf_verification.yml @@ -23,6 +23,12 @@ jobs: steps: - uses: actions/checkout@v5 + - name: Install deps + run: | + sudo apt-get -qq update + sudo apt-get -qq -y install libblas-dev liblapack-dev + if: runner.os == 'Linux' + - name: Setup Python uses: actions/setup-python@v6 id: setup-python diff --git a/tests/math_tests.cpp b/tests/math_tests.cpp index 3897b1dc..5dc685e4 100644 --- a/tests/math_tests.cpp +++ b/tests/math_tests.cpp @@ -74,8 +74,10 @@ TEST_CASE("getH gives the cross product matrix") vec testVec; testVec << 1, 2, 3; + std::cout << "testVec=" << std::endl << testVec << std::endl; vec v{ 0.3, 0.2, 0.1 }; + std::cout << "v=" << std::endl << v << std::endl; // getH() should create a matrix that replicates the behavior of the cross // product such that getH(v) * a == -v.cross(a) REQUIRE_THAT(getH(v) * testVec, IsClose(v.cross(-testVec))); From b30f014f976cdb673087890bc8b10ce06999b849 Mon Sep 17 00:00:00 2001 From: Jose Luis Cercos-Pita Date: Tue, 18 Nov 2025 08:17:42 +0100 Subject: [PATCH 6/7] fix(tests): Inline initialization of testVec --- tests/math_tests.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/math_tests.cpp b/tests/math_tests.cpp index 5dc685e4..0fdb5057 100644 --- a/tests/math_tests.cpp +++ b/tests/math_tests.cpp @@ -72,12 +72,8 @@ using namespace md; TEST_CASE("getH gives the cross product matrix") { - vec testVec; - testVec << 1, 2, 3; - std::cout << "testVec=" << std::endl << testVec << std::endl; - + vec testVec{ 1.0, 2.0, 3.0 }; vec v{ 0.3, 0.2, 0.1 }; - std::cout << "v=" << std::endl << v << std::endl; // getH() should create a matrix that replicates the behavior of the cross // product such that getH(v) * a == -v.cross(a) REQUIRE_THAT(getH(v) * testVec, IsClose(v.cross(-testVec))); From 083e9298e840e0f2c535cfeea2df1b8989b664dd Mon Sep 17 00:00:00 2001 From: Jose Luis Cercos-Pita Date: Tue, 18 Nov 2025 10:03:38 +0100 Subject: [PATCH 7/7] fix(tests): Fixed the math tests for MacOS-arm64 arch --- tests/math_tests.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/tests/math_tests.cpp b/tests/math_tests.cpp index 0fdb5057..1f8039cd 100644 --- a/tests/math_tests.cpp +++ b/tests/math_tests.cpp @@ -25,37 +25,37 @@ template struct IsCloseMatcher : Catch::Matchers::MatcherGenericBase { IsCloseMatcher( - const Eigen::Ref a, + const DerivedA& a, const typename DerivedA::RealScalar rtol = Eigen::NumTraits::dummy_precision(), const typename DerivedA::RealScalar atol = Eigen::NumTraits::epsilon()) - : a(a) - , rtol(rtol) - , atol(atol) + : _a(a) + , _rtol(rtol) + , _atol(atol) { } template - bool match(const Eigen::DenseBase& b) const + bool match(const DerivedB& b) const { - return ((a.derived() - b.derived()).array().abs() <= - (atol + rtol * b.derived().array().abs())) + return ((_a.derived() - b.derived()).array().abs() <= + (_atol + _rtol * b.derived().array().abs())) .all(); } std::string describe() const override { std::stringstream ss; - ss << "Is close to: " << Catch::StringMaker::convert(a) - << "\nrtol = " << rtol << ", atol = " << atol; + ss << "Is close to: " << Catch::StringMaker::convert(_a) + << "\nrtol = " << _rtol << ", atol = " << _atol; return ss.str(); } private: - const Eigen::Ref a; - const typename DerivedA::RealScalar rtol; - const typename DerivedA::RealScalar atol; + const DerivedA _a; + const typename DerivedA::RealScalar _rtol; + const typename DerivedA::RealScalar _atol; }; template @@ -76,7 +76,8 @@ TEST_CASE("getH gives the cross product matrix") vec v{ 0.3, 0.2, 0.1 }; // getH() should create a matrix that replicates the behavior of the cross // product such that getH(v) * a == -v.cross(a) - REQUIRE_THAT(getH(v) * testVec, IsClose(v.cross(-testVec))); + vec ref = v.cross(-testVec); + REQUIRE_THAT(getH(v) * testVec, IsClose(ref)); } TEST_CASE("translateMass linear acceleration")