Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
76 changes: 0 additions & 76 deletions .github/workflows/builds.yml

This file was deleted.

118 changes: 93 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
test:
runs-on: ubuntu-latest
container:
image: rockylinux:8
image: rockylinux/rockylinux:9

defaults:
run:
Expand All @@ -28,14 +28,16 @@ jobs:
- name: Install system dependencies
run: |
dnf install -y epel-release
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled crb
dnf update -y
dnf install -y bison clang flex git llvm make maven swig cmake clang-devel \
gcc gcc-c++ java-11-openjdk-devel libxml2-devel llvm-devel llvm-static \
ncurses-devel openmotif openmotif-devel perl perl-Digest-MD5 udunits2 \
udunits2-devel which zlib-devel libX11-devel libXt-devel \
python3-devel diffutils
dnf config-manager --enable powertools
dnf install -y gtest-devel gmock-devel libasan liblsan libubsan
dnf install -y \
bash bison clang clang-devel cmake diffutils flex gcc \
gcc-c++ git java-17-openjdk-devel \
libxml2-devel llvm-devel llvm-static maven ncurses-devel \
motif motif-devel perl perl-Digest-MD5 python3-devel \
swig udunits2 udunits2-devel which zlib-devel \
gtest-devel gmock-devel libasan liblsan libubsan

- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -89,27 +91,72 @@ jobs:
trick-CP
make spotless

- name: Build verification sims
id: build_verif_sims
# Each model category has its verification sims built, run, and sim outputs
# compared one at a time. After doing so, artifacts are purged. GitHub Actions
# have limited memory allocated, so attempting to build/run all sims at once
# is likely to run out of memory.
- name: Dynamics model verification sims
id: dynamics_verif_sims
if: ${{ env.RUN_VERIF_SIMS == 'true' }}
run: |
export PATH=${TRICK_HOME}/bin:${PATH}
source .bashrc
./bin/test.py builds --quiet
./bin/test.py builds runs comparisons -j $(nproc) --quiet -m models/dynamics
git -C models/dynamics clean -x -d -f

- name: Run verification sims
id: run_verif_sims
- name: Environment model verification sims
id: environment_verif_sims
if: ${{ env.RUN_VERIF_SIMS == 'true' }}
run: |
export PATH=${TRICK_HOME}/bin:${PATH}
source .bashrc
./bin/test.py builds runs comparisons -j $(nproc) --quiet -m models/environment
git -C models/environment clean -x -d -f

- name: Fhw model verification sims
id: fhw_verif_sims
if: ${{ env.RUN_VERIF_SIMS == 'true' }}
run: |
export PATH=${TRICK_HOME}/bin:${PATH}
source .bashrc
./bin/test.py builds runs comparisons -j $(nproc) --quiet -m models/fhw
git -C models/fhw clean -x -d -f

- name: Interactions model verification sims
id: interactions_verif_sims
if: ${{ env.RUN_VERIF_SIMS == 'true' }}
run: |
export PATH=${TRICK_HOME}/bin:${PATH}
source .bashrc
./bin/test.py builds runs comparisons -j $(nproc) --quiet -m models/interactions
git -C models/interactions clean -x -d -f

- name: Tools model verification sims
id: tools_verif_sims
if: ${{ env.RUN_VERIF_SIMS == 'true' }}
run: |
export PATH=${TRICK_HOME}/bin:${PATH}
source .bashrc
./bin/test.py builds runs comparisons -j $(nproc) --quiet -m models/tools
git -C models/tools clean -x -d -f

- name: Utilities model verification sims
id: utilities_verif_sims
if: ${{ env.RUN_VERIF_SIMS == 'true' }}
run: |
export PATH=${TRICK_HOME}/bin:${PATH}
source .bashrc
./bin/test.py runs --quiet
./bin/test.py builds runs comparisons -j $(nproc) --quiet -m models/utilities
git -C models/utilities clean -x -d -f

- name: Compare verification data
id: compare_verif_sim_data
- name: Vehicle management model verification sims
id: vehicle_management_verif_sims
if: ${{ env.RUN_VERIF_SIMS == 'true' }}
run: |
export PATH=${TRICK_HOME}/bin:${PATH}
source .bashrc
./bin/test.py comparisons --quiet
./bin/test.py builds runs comparisons -j $(nproc) --quiet -m models/vehicle_management
git -C models/vehicle_management clean -x -d -f

- name: Generate coverage report
if: ${{ env.RUN_VERIF_SIMS == 'true' }}
Expand All @@ -120,24 +167,45 @@ jobs:
--exclude '.*/test/.*' --exclude utility/mocks \
--filter '^models/.*' -o coverage.xml

- name: Upload coverage report
- name: Save coverage report
if: ${{ env.RUN_VERIF_SIMS == 'true' }}
uses: coverallsapp/github-action@v2
uses: actions/upload-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: coverage.xml
format: cobertura
name: coverage-xml
path: coverage.xml

- name: Upload logs on failure
if: >-
${{ failure() && env.RUN_VERIF_SIMS == 'true' && (
steps.build_verif_sims.outcome == 'failure' ||
steps.run_verif_sims.outcome == 'failure' ||
steps.compare_verif_sim_data.outcome == 'failure'
steps.dynamics_verif_sims.outcome == 'failure' ||
steps.environment_verif_sims.outcome == 'failure' ||
steps.fhw_verif_sims.outcome == 'failure' ||
steps.interactions_verif_sims.outcome == 'failure' ||
steps.tools_verif_sims.outcome == 'failure' ||
steps.utilities_verif_sims.outcome == 'failure' ||
steps.vehicle_management_verif_sims.outcome == 'failure'
) }}
uses: actions/upload-artifact@v4
with:
name: verif-sim-failure-logs
path: bin/logs/*.txt
if-no-files-found: warn
retention-days: 2

coverage:
needs: test
if: ${{ needs.test.result == 'success' && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: coverage-xml

- uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: coverage.xml
format: cobertura
32 changes: 18 additions & 14 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
code-format:
runs-on: ubuntu-latest
container:
image: rockylinux:8
image: rockylinux/rockylinux:9

defaults:
run:
Expand All @@ -22,7 +22,8 @@ jobs:
- name: Install system dependencies
run: |
dnf install -y epel-release
dnf config-manager --enable powertools
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled crb
dnf update -y
dnf install -y git python3-devel

Expand Down Expand Up @@ -79,7 +80,7 @@ jobs:
cppcheck:
runs-on: ubuntu-latest
container:
image: rockylinux:8
image: rockylinux/rockylinux:9

defaults:
run:
Expand All @@ -89,11 +90,12 @@ jobs:
- name: Install system dependencies
run: |
dnf install -y epel-release
dnf config-manager --enable powertools
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled crb
dnf update -y
dnf install -y git make cmake gcc gcc-c++ libxml2-devel openmotif-devel \
perl perl-Digest-MD5 udunits2-devel zlib-devel libX11-devel libXt-devel \
python3-devel cppcheck
dnf install -y git bison clang clang-devel cmake diffutils flex gcc \
gcc-c++ libxml2-devel llvm-devel llvm-static perl perl-Digest-MD5 \
python3-devel udunits2 udunits2-devel zlib-devel cppcheck

- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -149,8 +151,9 @@ jobs:
--project=build/debug/compile_commands.json \
--max-configs=1 \
--enable=all \
-i ${{ env.CML_HOME }}/models/environment/EGM2008/src/egm_2008_data.cc \
-i ${{ env.CML_HOME }}/models/environment/gravity/lunar_GRGM900C/data/src/GRGM900C_lunar_gravity.cc \
--inline-suppr \
-i models/environment/EGM2008/src/egm_2008_data.cc \
-i models/environment/gravity/lunar_GRGM900C/data/src/GRGM900C_lunar_gravity.cc \
-j $(nproc) \
--suppress=unusedFunction \
--suppress=unmatchedSuppression \
Expand All @@ -170,7 +173,7 @@ jobs:
clang-tidy:
runs-on: ubuntu-latest
container:
image: rockylinux:8
image: rockylinux/rockylinux:9

defaults:
run:
Expand All @@ -180,11 +183,12 @@ jobs:
- name: Install system dependencies
run: |
dnf install -y epel-release
dnf config-manager --enable powertools
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled crb
dnf update -y
dnf install -y git make cmake gcc gcc-c++ libxml2-devel openmotif-devel \
perl perl-Digest-MD5 udunits2-devel zlib-devel libX11-devel libXt-devel \
python3-devel clang-tools-extra
dnf install -y git bison clang clang-devel cmake diffutils flex gcc \
gcc-c++ libxml2-devel llvm-devel llvm-static perl perl-Digest-MD5 \
python3-devel udunits2 udunits2-devel zlib-devel clang-tools-extra

- name: Checkout code
uses: actions/checkout@v4
Expand Down
8 changes: 6 additions & 2 deletions bin/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,12 @@ def _get_sims_to_test(self):
if len(args.model) > 0:
all_sims = self.get_sims()
for sim in all_sims:
if 'model_dir' in self.config[sim.name] and os.path.normpath(self.config[sim.name]['model_dir']) in args.model:
sims.append(sim)
if 'model_dir' not in self.config[sim.name]:
continue

for model_path in args.model:
if os.path.normpath(model_path) in os.path.normpath(self.config[sim.name]['model_dir']):
sims.append(sim)
else:
sims = self.get_sims()
return sims
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ LIBRARY DEPENDENCIES:
**********************************************************************/

#include <cmath>
#include <new>

#include "../include/accumulated_absolute_deltas.hh"
#include "cml/models/utilities/cml_message/include/cml_message.hh"
Expand Down Expand Up @@ -110,4 +109,4 @@ AccumulatedAbsoluteDeltas::update()
accumulated_deltas[ii] += std::abs( variable[ii] - old_variable[ii]);
old_variable[ii] = variable[ii];
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Destructor
Vector3IntegrableObject::~Vector3IntegrableObject ()
{
JEOD_DEREGISTER_CHECKPOINTABLE (this, integrator);
destroy_integrators();
integrator.destroy_integrator();
}

/*****************************************************************************
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ void
MassDerivativeDynamics::compute_J_dot()
{
size_t ix = 0;
double J_dot_6[6]; // The differences of the 6 unique elements of the
// inertia tensor.
double J_dot_6[6] {}; // The differences of the 6 unique elements of the
// inertia tensor.
// Step through the upper triangle (including diagonals) of the inertia
// tensor. Ignore the 3 terms in the lower triangle; they are duplicates.
for (size_t ii = 0; ii < 3; ++ii) {
Expand Down Expand Up @@ -413,4 +413,4 @@ MassDerivativeDynamics::modify_velocity()
body.set_velocity( new_body_vel,
body.composite_body);
body.propagate_state();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ sys.exec.out.time {s},vehicle.body.composite_body.state.rot.ang_vel_this[2] {rad
12.8, 0.2459047908207068, 5.879999999999677, 12.7950000000006, 0.5124294201577408,-0.06702596140490104, 0.03112965921388497, -0.1035027931244448, 0, -0.1770514493908224, 0, 0.0267295190056378,-0.01389092569246845, 0, 62.53978429308722
12.9, 0.2421726819109092, 5.839999999999681, 12.89500000000062, 0.5156761873626826,-0.07744439533339866, 0.03380740814416328, -0.104853093762185, 0, -0.1743643309757694, 0, 0.02683242709024384,-0.01312300587759523, 0, 63.93800820786262
13, 0.2384721429079142, 5.799999999999685, 12.99500000000063, 0.5191912005037786, -0.0879940427013635, 0.036494150805795, -0.1061272865416016, 0, -0.1716999428936143, 0, 0.02690969660546329,-0.01236857786390502, 0, 65.3149391795621
13.1, 0.2348031217689792, 5.75999999999969, 13.09500000000065, 0.5229752326449836,-0.09866736109601604, 0.03918737954503081, -0.1073267478587793, 0, -0.1690582476736425, 0, 0.02696243990969512,-0.01162817783718432, 0, 66.67075794146562
13.1, 0.2348031217689792, 5.75999999999969, 13.09500000000065, 0.5229752326449836,-0.09866736109601604, 0.03918737954503081, -0.1073267478587793, 0, -0.1690582476736425, 0, 0.02696243990969512,-0.01162817783718432, 0, 66.67075794146564
13.2, 0.2311655661778041, 5.719999999999694, 13.19500000000066, 0.5270288116196279, -0.1094569483247174, 0.0418846971322261, -0.1084529047353899, 0, -0.1664392076479968, 0, 0.02699175309664073,-0.01090228285728533, 0, 68.00564492788811
13.3, 0.2275594235411786, 5.679999999999699, 13.29500000000068, 0.5313522309884308, -0.1203555471866692, 0.04458381504400054, -0.1095072290485962, 0, -0.1638427849495686, 0, 0.02699871420213562,-0.01019131368412536, 0, 69.31978027260242
13.4, 0.2239846409855635, 5.639999999999703, 13.39500000000069, 0.5359455608170945, -0.1313560496816676, 0.04728255157604788, -0.1104912320415627, 0, -0.161268941509527, 0, 0.02698438160776891,-0.009495637563173702, 0, 70.61334380724306
Expand Down
Loading
Loading