From 6a032b445b984bb1010d86289c6bf279b6c6ebb4 Mon Sep 17 00:00:00 2001 From: Ahnaf Tahmid Chowdhury Date: Tue, 20 Feb 2024 11:11:31 +0600 Subject: [PATCH 01/10] remove using container --- .github/workflows/housekeeping.yml | 31 +++++++++++++++++------------- CI/Dockerfile_1_housekeeping | 7 ------- 2 files changed, 18 insertions(+), 20 deletions(-) delete mode 100644 CI/Dockerfile_1_housekeeping diff --git a/.github/workflows/housekeeping.yml b/.github/workflows/housekeeping.yml index c5ade3c6dd..323a65ea79 100644 --- a/.github/workflows/housekeeping.yml +++ b/.github/workflows/housekeeping.yml @@ -1,4 +1,4 @@ -name: Housekeeping checks +name: Housekeeping Checks on: # allows us to run workflows manually @@ -8,21 +8,22 @@ on: - develop 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 @@ -32,10 +33,14 @@ 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 exit 1 fi diff --git a/CI/Dockerfile_1_housekeeping b/CI/Dockerfile_1_housekeeping deleted file mode 100644 index 43065975c4..0000000000 --- a/CI/Dockerfile_1_housekeeping +++ /dev/null @@ -1,7 +0,0 @@ -ARG UBUNTU_VERSION=18.04 -ARG OWNER=svalinn -ARG TAG=latest -FROM ghcr.io/${OWNER}/dagmc-ci-ubuntu-${UBUNTU_VERSION}:$TAG - -RUN pip install sphinx; \ - apt-get -y install clang-format From 4142682ce5d530a8e42160e31597306261c07b84 Mon Sep 17 00:00:00 2001 From: Ahnaf Tahmid Chowdhury Date: Tue, 20 Feb 2024 11:22:04 +0600 Subject: [PATCH 02/10] Simplify Housekeeping Process for DAGMC --- doc/CHANGELOG.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/CHANGELOG.rst b/doc/CHANGELOG.rst index 02e51f13d1..2a3fc7886d 100644 --- a/doc/CHANGELOG.rst +++ b/doc/CHANGELOG.rst @@ -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 ==================== From e0568c0329b5a95e660d4678fff43e26f6e5cc9f Mon Sep 17 00:00:00 2001 From: Ahnaf Tahmid Chowdhury Date: Wed, 21 Feb 2024 11:30:43 +0600 Subject: [PATCH 03/10] clang-format --- .github/workflows/housekeeping.yml | 10 ++++++++++ src/dagmc/DagMC.hpp | 10 ++++------ src/dagmc/tools/ray_fire_test.cpp | 2 +- src/geant4/DagSolid.cc | 2 +- src/geant4/app/include/ExN01UserScoreWriter.hh | 2 +- src/tally/CellTally.cpp | 6 +++--- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/housekeeping.yml b/.github/workflows/housekeeping.yml index 323a65ea79..0a2b8242b2 100644 --- a/.github/workflows/housekeeping.yml +++ b/.github/workflows/housekeeping.yml @@ -42,5 +42,15 @@ jobs: 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 diff --git a/src/dagmc/DagMC.hpp b/src/dagmc/DagMC.hpp index 47c10842a4..45744bc286 100644 --- a/src/dagmc/DagMC.hpp +++ b/src/dagmc/DagMC.hpp @@ -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 mb_impl, ... " - ")")]] DagMC(Interface* mb_impl, - double overlap_tolerance = 0., - double numerical_precision = .001, - int verbosity = 1); + [[deprecated( + "Replaced by DagMC(std::shared_ptr mb_impl, ... " + ")")]] DagMC(Interface* mb_impl, double overlap_tolerance = 0., + double numerical_precision = .001, int verbosity = 1); // Destructor ~DagMC(); diff --git a/src/dagmc/tools/ray_fire_test.cpp b/src/dagmc/tools/ray_fire_test.cpp index ee4b5f25eb..13e9f45dca 100644 --- a/src/dagmc/tools/ray_fire_test.cpp +++ b/src/dagmc/tools/ray_fire_test.cpp @@ -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); diff --git a/src/geant4/DagSolid.cc b/src/geant4/DagSolid.cc index 0e15537160..05b8d4c97a 100644 --- a/src/geant4/DagSolid.cc +++ b/src/geant4/DagSolid.cc @@ -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. diff --git a/src/geant4/app/include/ExN01UserScoreWriter.hh b/src/geant4/app/include/ExN01UserScoreWriter.hh index 35b2a11ec1..9c8975ed15 100644 --- a/src/geant4/app/include/ExN01UserScoreWriter.hh +++ b/src/geant4/app/include/ExN01UserScoreWriter.hh @@ -1,7 +1,7 @@ #ifndef ExN01UserScoreWriter_h #define ExN01UserScoreWriter_h 1 -//#include "MBCore.hpp" +// #include "MBCore.hpp" #include #include "G4VScoreWriter.hh" diff --git a/src/tally/CellTally.cpp b/src/tally/CellTally.cpp index f89c98ce51..53f52b4b0e 100644 --- a/src/tally/CellTally.cpp +++ b/src/tally/CellTally.cpp @@ -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; From 1870a382902e5e43ad3ffb8490ca76c49a32c488 Mon Sep 17 00:00:00 2001 From: Ahnaf Tahmid Chowdhury Date: Wed, 21 Feb 2024 16:18:21 +0600 Subject: [PATCH 04/10] run on only source files --- .github/workflows/housekeeping.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/housekeeping.yml b/.github/workflows/housekeeping.yml index 0a2b8242b2..30200b54a0 100644 --- a/.github/workflows/housekeeping.yml +++ b/.github/workflows/housekeeping.yml @@ -6,6 +6,8 @@ on: pull_request: branches: - develop + paths: + - 'src/**' jobs: main: From 156ed44232b5a988a396e05e7b2cd67e86e33416 Mon Sep 17 00:00:00 2001 From: Ahnaf Tahmid Chowdhury Date: Wed, 21 Feb 2024 16:20:07 +0600 Subject: [PATCH 05/10] remove extra space --- .github/workflows/housekeeping.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/housekeeping.yml b/.github/workflows/housekeeping.yml index 30200b54a0..5b73c60792 100644 --- a/.github/workflows/housekeeping.yml +++ b/.github/workflows/housekeeping.yml @@ -50,7 +50,7 @@ jobs: 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 " \\( -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." From 0462f66b7c7e537870fabf2f2f8093b70b1e7316 Mon Sep 17 00:00:00 2001 From: Ahnaf Tahmid Chowdhury Date: Wed, 21 Feb 2024 16:23:38 +0600 Subject: [PATCH 06/10] add housekeeping to path --- .github/workflows/housekeeping.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/housekeeping.yml b/.github/workflows/housekeeping.yml index 5b73c60792..2f14af2f39 100644 --- a/.github/workflows/housekeeping.yml +++ b/.github/workflows/housekeeping.yml @@ -8,6 +8,7 @@ on: - develop paths: - 'src/**' + - '.github/workflows/housekeeping.yml' jobs: main: From 0cb0ff155b94ff7a62a1e85ad9f687fa7001a6e6 Mon Sep 17 00:00:00 2001 From: Ahnaf Tahmid Chowdhury Date: Wed, 21 Feb 2024 23:46:21 +0600 Subject: [PATCH 07/10] remove comment MBCore.hpp --- src/geant4/app/include/ExN01UserScoreWriter.hh | 1 - 1 file changed, 1 deletion(-) diff --git a/src/geant4/app/include/ExN01UserScoreWriter.hh b/src/geant4/app/include/ExN01UserScoreWriter.hh index 9c8975ed15..17dd1b1c9c 100644 --- a/src/geant4/app/include/ExN01UserScoreWriter.hh +++ b/src/geant4/app/include/ExN01UserScoreWriter.hh @@ -1,7 +1,6 @@ #ifndef ExN01UserScoreWriter_h #define ExN01UserScoreWriter_h 1 -// #include "MBCore.hpp" #include #include "G4VScoreWriter.hh" From 8c17eb3254750e2ad3579915770824c8717e5e07 Mon Sep 17 00:00:00 2001 From: Ahnaf Tahmid Chowdhury Date: Wed, 21 Feb 2024 23:46:31 +0600 Subject: [PATCH 08/10] housekeeping --- .github/workflows/housekeeping.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/housekeeping.yml b/.github/workflows/housekeeping.yml index 2f14af2f39..e0a27d75fc 100644 --- a/.github/workflows/housekeeping.yml +++ b/.github/workflows/housekeeping.yml @@ -48,7 +48,7 @@ jobs: 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 "You can use the following command to format all files 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*\" \\) \\" From ef1735474c7d2ab65a090190ffb5604c2cabbe4f Mon Sep 17 00:00:00 2001 From: Ahnaf Tahmid Chowdhury Date: Thu, 22 Feb 2024 11:55:19 +0600 Subject: [PATCH 09/10] EIGEN3_DIR=${CONDA_LOC} --- .github/workflows/windows_build_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows_build_test.yml b/.github/workflows/windows_build_test.yml index 004664742d..ab9cbcdef1 100644 --- a/.github/workflows/windows_build_test.yml +++ b/.github/workflows/windows_build_test.yml @@ -76,6 +76,7 @@ jobs: -DBUILD_SHARED_LIBS=ON \ -G"Visual Studio 16 2019" \ -DCMAKE_INSTALL_PREFIX=../install_dir/ \ + -DEIGEN3_DIR="${CONDA_LOC}" \ -DHDF5_ROOT="${CONDA_LOC}" \ -DHDF5_hdf5_LIBRARY_RELEASE="${CONDA_LOC}/lib/libhdf5_hl.lib;${CONDA_LOC}/lib/libhdf5.lib;${CONDA_LOC}/lib/zlib.lib;${CONDA_LOC}/lib/libhdf5_cpp.lib" \ -DCMAKE_EXE_LINKER_FLAGS="/std:c++latest -DH5_BUILT_AS_DYNAMIC_LIB" \ From 98a2936ba48278c82be154e261759a0fe255a090 Mon Sep 17 00:00:00 2001 From: Ahnaf Tahmid Chowdhury Date: Thu, 22 Feb 2024 12:02:11 +0600 Subject: [PATCH 10/10] EIGEN3_DIR="${CONDA_LOC}/include/eigen3" --- .github/workflows/windows_build_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows_build_test.yml b/.github/workflows/windows_build_test.yml index ab9cbcdef1..a2a9ba273a 100644 --- a/.github/workflows/windows_build_test.yml +++ b/.github/workflows/windows_build_test.yml @@ -76,7 +76,7 @@ jobs: -DBUILD_SHARED_LIBS=ON \ -G"Visual Studio 16 2019" \ -DCMAKE_INSTALL_PREFIX=../install_dir/ \ - -DEIGEN3_DIR="${CONDA_LOC}" \ + -DEIGEN3_DIR="${CONDA_LOC}/include/eigen3" \ -DHDF5_ROOT="${CONDA_LOC}" \ -DHDF5_hdf5_LIBRARY_RELEASE="${CONDA_LOC}/lib/libhdf5_hl.lib;${CONDA_LOC}/lib/libhdf5.lib;${CONDA_LOC}/lib/zlib.lib;${CONDA_LOC}/lib/libhdf5_cpp.lib" \ -DCMAKE_EXE_LINKER_FLAGS="/std:c++latest -DH5_BUILT_AS_DYNAMIC_LIB" \