Skip to content

Commit 34fa76d

Browse files
feat(ci): Upgrade all (ubuntu, windows and macos) to their latest images
* feat(ci): Upgrade to Windows-latest * feat(ci): Upgrade to Ubuntu-latest * feat(ci): Added to MacOS-latest * fix(ci): Set ubuntu-latest on all pipelines * fix(ci): Install MoorDynF Blas and Lapack deps * fix(tests): Inline initialization of testVec * fix(tests): Fixed the math tests for MacOS-arm64 arch
1 parent 66db3e8 commit 34fa76d

File tree

8 files changed

+44
-23
lines changed

8 files changed

+44
-23
lines changed

.github/workflows/build-test.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
needs: [create_release]
7272
strategy:
7373
matrix:
74-
os: [ubuntu-22.04, windows-2022]
74+
os: [ubuntu-latest, windows-latest, macos-latest]
7575

7676
steps:
7777
- uses: actions/checkout@v5
@@ -92,6 +92,22 @@ jobs:
9292
compiler: gcc
9393
if: runner.os == 'Linux'
9494

95+
- name: Setup NSIS (Windows)
96+
run: |
97+
iwr -useb get.scoop.sh -outfile 'install.ps1'
98+
.\install.ps1 -RunAsAdmin
99+
scoop update
100+
scoop bucket add extras
101+
scoop install nsis
102+
Add-Content $env:GITHUB_PATH "C:\Users\runneradmin\scoop\shims\"
103+
if: runner.os == 'Windows'
104+
105+
- name: Install Rust-bindgen (Linux)
106+
run: |
107+
sudo apt-get -qq update
108+
sudo apt-get -qq -y install bindgen
109+
if: runner.os == 'Linux'
110+
95111
- name: Install VTK (Linux)
96112
run: |
97113
sudo apt-get -qq update

.github/workflows/mdf_verification.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,17 @@ jobs:
1818
runs-on: ${{ matrix.os }}
1919
strategy:
2020
matrix:
21-
os: [ubuntu-22.04]
21+
os: [ubuntu-latest]
2222

2323
steps:
2424
- uses: actions/checkout@v5
2525

26+
- name: Install deps
27+
run: |
28+
sudo apt-get -qq update
29+
sudo apt-get -qq -y install libblas-dev liblapack-dev
30+
if: runner.os == 'Linux'
31+
2632
- name: Setup Python
2733
uses: actions/setup-python@v6
2834
id: setup-python

.github/workflows/memcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ${{ matrix.os }}
1717
strategy:
1818
matrix:
19-
os: [ubuntu-22.04]
19+
os: [ubuntu-latest]
2020

2121
steps:
2222
- uses: actions/checkout@v5

.github/workflows/python-wheels-emulated.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
description: 'Host OS'
88
required: false
99
type: string
10-
default: '["ubuntu-22.04"]'
10+
default: '["ubuntu-latest"]'
1111
arch:
1212
description: 'Architecture target'
1313
required: true

.github/workflows/python-wheels-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
description: 'Host OS'
88
required: false
99
type: string
10-
default: '["ubuntu-22.04"]'
10+
default: '["ubuntu-latest"]'
1111
arch:
1212
description: 'Architecture target'
1313
required: true

.github/workflows/python-wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
name: Build Linux_x86_64
4747
uses: FloatingArrayDesign/MoorDyn/.github/workflows/python-wheels-emulated.yml@master
4848
with:
49-
os: '["ubuntu-22.04"]'
49+
os: '["ubuntu-latest"]'
5050
arch: "x86_64"
5151
secrets: inherit
5252

.github/workflows/python-wrapper.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ${{ matrix.os }}
2222
strategy:
2323
matrix:
24-
os: [ubuntu-22.04]
24+
os: [ubuntu-latest]
2525

2626
steps:
2727
- uses: actions/checkout@v5

tests/math_tests.cpp

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,37 @@ template<typename DerivedA>
2525
struct IsCloseMatcher : Catch::Matchers::MatcherGenericBase
2626
{
2727
IsCloseMatcher(
28-
const Eigen::Ref<const DerivedA> a,
28+
const DerivedA& a,
2929
const typename DerivedA::RealScalar rtol =
3030
Eigen::NumTraits<typename DerivedA::RealScalar>::dummy_precision(),
3131
const typename DerivedA::RealScalar atol =
3232
Eigen::NumTraits<typename DerivedA::RealScalar>::epsilon())
33-
: a(a)
34-
, rtol(rtol)
35-
, atol(atol)
33+
: _a(a)
34+
, _rtol(rtol)
35+
, _atol(atol)
3636
{
3737
}
3838

3939
template<typename DerivedB>
40-
bool match(const Eigen::DenseBase<DerivedB>& b) const
40+
bool match(const DerivedB& b) const
4141
{
42-
return ((a.derived() - b.derived()).array().abs() <=
43-
(atol + rtol * b.derived().array().abs()))
42+
return ((_a.derived() - b.derived()).array().abs() <=
43+
(_atol + _rtol * b.derived().array().abs()))
4444
.all();
4545
}
4646

4747
std::string describe() const override
4848
{
4949
std::stringstream ss;
50-
ss << "Is close to: " << Catch::StringMaker<DerivedA>::convert(a)
51-
<< "\nrtol = " << rtol << ", atol = " << atol;
50+
ss << "Is close to: " << Catch::StringMaker<DerivedA>::convert(_a)
51+
<< "\nrtol = " << _rtol << ", atol = " << _atol;
5252
return ss.str();
5353
}
5454

5555
private:
56-
const Eigen::Ref<const DerivedA> a;
57-
const typename DerivedA::RealScalar rtol;
58-
const typename DerivedA::RealScalar atol;
56+
const DerivedA _a;
57+
const typename DerivedA::RealScalar _rtol;
58+
const typename DerivedA::RealScalar _atol;
5959
};
6060

6161
template<typename T>
@@ -72,13 +72,12 @@ using namespace md;
7272
TEST_CASE("getH gives the cross product matrix")
7373
{
7474

75-
vec testVec;
76-
testVec << 1, 2, 3;
77-
75+
vec testVec{ 1.0, 2.0, 3.0 };
7876
vec v{ 0.3, 0.2, 0.1 };
7977
// getH() should create a matrix that replicates the behavior of the cross
8078
// product such that getH(v) * a == -v.cross(a)
81-
REQUIRE_THAT(getH(v) * testVec, IsClose(v.cross(-testVec)));
79+
vec ref = v.cross(-testVec);
80+
REQUIRE_THAT(getH(v) * testVec, IsClose(ref));
8281
}
8382

8483
TEST_CASE("translateMass linear acceleration")

0 commit comments

Comments
 (0)