From b979402f6ed1e45a369117008a86605f997f9cbc Mon Sep 17 00:00:00 2001 From: arnaud Date: Mon, 16 Oct 2023 12:09:43 +0200 Subject: [PATCH] Test_workflow_dispatch Signed-off-by: arnaud --- .github/workflows/ci_centos7.yml | 78 +++++++++++++++++++++++++++++ metrix-simulator/log/src/logger.cpp | 2 +- 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci_centos7.yml diff --git a/.github/workflows/ci_centos7.yml b/.github/workflows/ci_centos7.yml new file mode 100644 index 000000000..d51a24bfb --- /dev/null +++ b/.github/workflows/ci_centos7.yml @@ -0,0 +1,78 @@ +name: CI-cpp-centos7 + +on: + workflow_dispatch: {} + push: {} + +defaults: + run: + shell: bash + +jobs: + linux: + name: Linux + runs-on: ubuntu-latest + container: 'centos:centos7' + steps: + - name: Install Dependancies + run: | + yum update -y + yum install -y epel-release + yum install -y git redhat-lsb-core make wget centos-release-scl scl-utils + yum install -y devtoolset-9 + + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 + with: + cmake-version: '3.22.x' + + - name: Checkout sources + uses: actions/checkout@v1 + + - name: Download Boost-release + uses: dsaltares/fetch-gh-release-asset@master + with: + repo: 'ARnDOSrte/Boost' + file: 'boost_1_73_0.zip' + target: 'boost_1_73_0.zip' + token: ${{ secrets.TEST_TOKEN_RELEASE }} + + - name: Unzip Boost + run: unzip boost_1_73_0.zip + + - name: Configure 3rd parties + run: | + source /opt/rh/devtoolset-9/enable + cmake -S $GITHUB_WORKSPACE/metrix-simulator/external -B $GITHUB_WORKSPACE/metrix-simulator/build-centos7/external + + - name: Build 3rd parties + run: | + cmake --build $GITHUB_WORKSPACE/metrix-simulator/build-centos7/external --parallel 2 + + - name: Configure CMake + run: | + source /opt/rh/devtoolset-9/enable + cmake -S $GITHUB_WORKSPACE/metrix-simulator -Wno-dev -DCMAKE_BUILD_TYPE=Release -DBoost_ROOT=$GITHUB_WORKSPACE/__w/Boost/Boost/boost_1_73_0/installBoost -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build-centos7/install -B $GITHUB_WORKSPACE/metrix-simulator/build-centos7 + + - name: Build + run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build-centos7 --target install --parallel 2 + + - name: Tests + run: cd $GITHUB_WORKSPACE/metrix-simulator/build-centos7 && ctest -j2 --output-on-failure + + - name: Prepare Metrix install + if: github.event_name == 'workflow_dispatch' + id: metrix-install + run: | + ARCHIVE_NAME="metrix-simulator-centos7.zip" + ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" + zip $ARCHIVE_PATH /__w/powsybl-metrix/powsybl-metrix/metrix-simulator/build-centos7/install/bin/metrix-simulator + echo "::set-output name=archive_name::$ARCHIVE_NAME" + echo "::set-output name=archive_path::$ARCHIVE_PATH" + + - name: Upload OR-Tools install artifact + if: github.event_name == 'workflow_dispatch' + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.metrix-install.outputs.archive_name }} + path: ${{ steps.metrix-install.outputs.archive_path }} \ No newline at end of file diff --git a/metrix-simulator/log/src/logger.cpp b/metrix-simulator/log/src/logger.cpp index 80b4e5b5d..854fb47a6 100644 --- a/metrix-simulator/log/src/logger.cpp +++ b/metrix-simulator/log/src/logger.cpp @@ -73,7 +73,7 @@ Logger::~Logger() if (!context_.stopped()) { context_.stop(); } - if (thread_ && thread_->get_id() != std::this_thread::get_id()) { + if (thread_ && !(thread_->get_id() == std::this_thread::get_id())) { thread_->join(); }