Skip to content

Commit

Permalink
Test_workflow_dispatch
Browse files Browse the repository at this point in the history
Signed-off-by: arnaud <[email protected]>
  • Loading branch information
ARnDOSrte committed Oct 16, 2023
1 parent 9ff93e9 commit b979402
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 1 deletion.
78 changes: 78 additions & 0 deletions .github/workflows/ci_centos7.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}
2 changes: 1 addition & 1 deletion metrix-simulator/log/src/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit b979402

Please sign in to comment.