Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Housekeeping Process for DAGMC #943

Merged
merged 11 commits into from
Feb 22, 2024
44 changes: 31 additions & 13 deletions .github/workflows/housekeeping.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
name: Housekeeping checks
name: Housekeeping Checks

on:
# allows us to run workflows manually
workflow_dispatch:
pull_request:
branches:
- develop
paths:
- 'src/**'
- '.github/workflows/housekeeping.yml'

jobs:
Housekeeping:
main:
runs-on: ubuntu-latest
container:
image: ghcr.io/svalinn/dagmc-ci-ubuntu-18.04-housekeeping:stable
steps:
- name: Checkout repository
uses: actions/checkout@v3

steps:
- name: Setup environment
run: |
echo "REPO_SLUG=${GITHUB_REPOSITORY}" >> $GITHUB_ENV
echo "PULL_REQUEST=$(echo $GITHUB_REF | cut -d"/" -f3)" >> $GITHUB_ENV
mkdir /root/build_dir
ln -s $GITHUB_WORKSPACE /root/build_dir/DAGMC


- name: Setup dependencies
run: |
sudo apt-get install -y clang-format

- name: Checkout repository
uses: actions/checkout@v3

- name: Housekeeping
run: |
cd $GITHUB_WORKSPACE
Expand All @@ -32,10 +36,24 @@ jobs:
-exec clang-format -style=file -i {} \;
clang_diffs=`git status --porcelain`
if [ -z "${clang_diffs}" ]; then
echo "Style guide checker passed!"
echo -e "\033[32mStyle guide checker passed!\033[0m"
else
echo "ERROR: Style guide checker failed. Please run clang-format."
echo "clang_diffs: ${clang_diffs}"
echo -e "\033[1;31mERROR: Style guide checker failed. Please run clang-format.\033[0m"
echo
echo -e "\033[33mClang diffs:\033[0m"
echo "${clang_diffs}"
echo
echo -e "\033[33mGit diff:\033[0m"
git diff
echo
echo -e "\033[1;31mPlease fix the style guide and commit the result.\033[0m"
echo
echo "You can use the following command to format your code at once."
echo
echo "find src/ \\( -name \"*.hpp\" -o -name \"*.cpp\" -o -name \"*.hh\" -o -name \"*.cc\" -o -name \"*.h\" \\) \\"
echo " \\( -not -path \"src/gtest*\" -not -path \"src/mcnp/mcnp?/Source/*\" -not -path \"src/pyne*\" \\) \\"
echo " -exec clang-format -style=file -i {} \\;"
echo
echo "This command will automatically format your code according to the project's style guide."
exit 1
fi
7 changes: 0 additions & 7 deletions CI/Dockerfile_1_housekeeping

This file was deleted.

1 change: 1 addition & 0 deletions doc/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Next version
* Update hdf5 to v1.14.3 from v1.10.4 (#931 #933)
* Ensure implicit complement handle is placed at the back of DAGMC volume indices (#935)
* Update MOAB to 5.5.1 from 5.3.0 (#939 #940)
* Simplify Housekeeping Process for DAGMC (#943)

v3.2.3
====================
Expand Down
10 changes: 4 additions & 6 deletions src/dagmc/DagMC.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,10 @@ class DagMC {
double overlap_tolerance = 0., double numerical_precision = .001,
int verbosity = 1);
// Deprecated Constructor
[
[deprecated("Replaced by DagMC(std::shared_ptr<Interface> mb_impl, ... "
")")]] DagMC(Interface* mb_impl,
double overlap_tolerance = 0.,
double numerical_precision = .001,
int verbosity = 1);
[[deprecated(
"Replaced by DagMC(std::shared_ptr<Interface> mb_impl, ... "
")")]] DagMC(Interface* mb_impl, double overlap_tolerance = 0.,
double numerical_precision = .001, int verbosity = 1);
// Destructor
~DagMC();

Expand Down
2 changes: 1 addition & 1 deletion src/dagmc/tools/ray_fire_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extern "C" int getrusage(int, struct rusage*);
using namespace moab;

// define following macro for verbose debugging of random ray generation
//#define DEBUG
// #define DEBUG
#if !defined(_MSC_VER) && !defined(__MINGW32__)
void get_time_mem(double& tot_time, double& user_time, double& sys_time,
double& tot_mem);
Expand Down
2 changes: 1 addition & 1 deletion src/geant4/DagSolid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ using namespace moab;

#define plot true

//#define G4SPECSDEBUG 1
// #define G4SPECSDEBUG 1
///////////////////////////////////////////////////////////////////////////////
//
// Standard contructor has blank name and defines no facets.
Expand Down
2 changes: 1 addition & 1 deletion src/geant4/app/include/ExN01UserScoreWriter.hh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef ExN01UserScoreWriter_h
#define ExN01UserScoreWriter_h 1

//#include "MBCore.hpp"
// #include "MBCore.hpp"
ahnaf-tahmid-chowdhury marked this conversation as resolved.
Show resolved Hide resolved
#include <vector>

#include "G4VScoreWriter.hh"
Expand Down
6 changes: 3 additions & 3 deletions src/tally/CellTally.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ void CellTally::write_data(double num_histories) {

std::cout << "cell id = " << cell_id << std::endl;
std::cout << "type = "
<< (expected_type == TallyEvent::COLLISION
? "collision "
: expected_type == TallyEvent::TRACK ? "track " : "none");
<< (expected_type == TallyEvent::COLLISION ? "collision "
: expected_type == TallyEvent::TRACK ? "track "
: "none");
std::cout << std::endl;

std::cout << "volume = " << cell_volume << std::endl << std::endl;
Expand Down
Loading