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

Feature/ortools dev ls #52

Open
wants to merge 14 commits into
base: feature/ortools
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
134 changes: 54 additions & 80 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,106 +8,80 @@ defaults:

jobs:
linux:
name: Linux
name: Linux xprs=${{ matrix.xprs }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
xprs: [ON, OFF]
steps:
- name: Install Boost
run: |
sudo apt-get update -y
sudo apt-get install -y libboost-all-dev

- name: Checkout sources
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Configure 3rd parties
run: >
cmake -S $GITHUB_WORKSPACE/metrix-simulator/external -B $GITHUB_WORKSPACE/metrix-simulator/build-linux/external

- name: Build 3rd parties
run: >
cmake --build $GITHUB_WORKSPACE/metrix-simulator/build-linux/external --parallel 2

- name: Configure CMake
run: >
cmake -Wno-dev -S $GITHUB_WORKSPACE/metrix-simulator -B $GITHUB_WORKSPACE/metrix-simulator/build-linux
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build-linux/install

- name: Build
run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build-linux --target install --parallel 2

- name: Tests
run: cd $GITHUB_WORKSPACE/metrix-simulator/build-linux && ctest -j8 --output-on-failure

qa:
name: QA - CI
runs-on: ubuntu-latest
steps:
- name: Install Java 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Install gcovr
run: sudo pip install gcovr

- name: Install Sonar wrapper
working-directory: ${{ runner.workspace }}
run: |
wget https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
unzip build-wrapper-linux-x86.zip

- name: Install Sonar scanner
working-directory: ${{ runner.workspace }}
- name: Setup xpress env
if: ${{ matrix.xprs == 'ON' }}
run: |
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip
unzip sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip
ln -s sonar-scanner-${SONAR_SCANNER_VERSION} sonar
rm sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip
env:
SONAR_SCANNER_VERSION: 3.3.0.1492

- name: Install Boost
run: |
sudo apt-get update -y
sudo apt-get install -y libboost-all-dev
echo "XPRESSDIR=${{ github.workspace }}/xpressmp813" >> $GITHUB_ENV
echo "XPRESS=${{ github.workspace }}/xpressmp813/bin" >> $GITHUB_ENV

- name: Checkout sources
uses: actions/checkout@v1
- name: Checkout Xpress linux
if: ${{ matrix.xprs == 'ON' }}
uses: actions/checkout@v2
with:
repository: jdarlay/xpressmp813Lin
path: ${{ env.XPRESSDIR }}
ref: master
token: ${{ secrets.ACCESS_TOKEN }}

- name: Configure 3rd parties
run: >
cmake -S $GITHUB_WORKSPACE/metrix-simulator/external -B $GITHUB_WORKSPACE/metrix-simulator/build/external
working-directory: metrix-simulator
run: |
cmake -S external \
-B build-linux/external \
-DCMAKE_BUILD_TYPE=Release \
-DUSE_XPRESS=${{ matrix.xprs }} \
-DXPRESS_ROOT="${{ env.XPRESSDIR }}"

- name: Build 3rd parties
run: >
cmake --build $GITHUB_WORKSPACE/metrix-simulator/build/external --parallel 2
working-directory: metrix-simulator
run: cmake --build build-linux/external --parallel 2

- name: Configure CMake
run: >
cmake -Wno-dev -S $GITHUB_WORKSPACE/metrix-simulator -B $GITHUB_WORKSPACE/metrix-simulator/build
-DCMAKE_BUILD_TYPE=Debug
-DCODE_COVERAGE=TRUE
-DMETRIX_RUN_ALL_TESTS=OFF
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install
working-directory: metrix-simulator
run: |
cmake -S . \
-B build-linux \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=build-linux/install \
-DINSTALL_CMAKE_DIR=. \
-DUSE_ORTOOLS=ON \
-DUSE_XPRESS=${{ matrix.xprs }} \
-DXPRESS_ROOT="${{ env.XPRESSDIR }}"

- name: Build
run: >
${{ runner.workspace }}/build-wrapper-linux-x86/build-wrapper-linux-x86-64
--out-dir $GITHUB_WORKSPACE/metrix-simulator/build/output
cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --parallel 2 --target install
working-directory: metrix-simulator
run: cmake --build build-linux --target install --parallel 2

- name: Tests
run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j8 --output-on-failure
working-directory: metrix-simulator/build-linux
run: ctest -j8 --output-on-failure

- name: Code coverage
run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target code-coverage
- name: Prepare metrix install
id: metrix-install
working-directory: metrix-simulator/build-linux
run: |
[ ${{ matrix.xprs }} == "ON" ] && ARCHIVE_NAME=metrix_xprs || ARCHIVE_NAME=metrix
ARCHIVE_PATH="${{ github.workspace }}/metrix-simulator/build-linux/install"
echo "::set-output name=archive_name::$ARCHIVE_NAME"
echo "::set-output name=archive_path::$ARCHIVE_PATH"

- name: Sonarcloud
working-directory: ${{ runner.workspace }}/powsybl-metrix/metrix-simulator
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: >
${{ runner.workspace }}/sonar/bin/sonar-scanner
-Dsonar.host.url=https://sonarcloud.io
- name: Upload metrix install artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.metrix-install.outputs.archive_name }}
path: ${{ steps.metrix-install.outputs.archive_path }}
35 changes: 0 additions & 35 deletions .github/workflows/maven.yml

This file was deleted.

115 changes: 0 additions & 115 deletions .github/workflows/qa_pr_cpp.yml

This file was deleted.

13 changes: 7 additions & 6 deletions metrix-simulator/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
.idea
install
coverage
/tests/*/*/out_s*
/tests/*/*/metrixOut.txt
tests/*/*/metrix*.log
tests/*/*/result.txt
/tests/**/out_s*
/tests/**/metrixOut.txt
/tests/**/metrix*.log
/tests/**/result.txt
/tests/**/LODF_matrix.csv
/tests/**/PTDF_matrix.csv
!tests/*_reference/**/*
out/**
/tests/*/*/LODF_matrix.csv
/tests/*/*/PTDF_matrix.csv

docs/doc/**

Expand Down
20 changes: 10 additions & 10 deletions metrix-simulator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost 1.66.0 REQUIRED COMPONENTS system program_options log filesystem)

# Sirius
if (USE_SIRIUS_SHARED)
set(SIRIUS_NAME sirius_solver)
else()
set(SIRIUS_NAME sirius_solver_static)
endif()

set(${SIRIUS_NAME}_ROOT ${CMAKE_CURRENT_BINARY_DIR}/external/sirius_solver CACHE PATH "Path where a Sirius installation already exists")
find_package(${SIRIUS_NAME} REQUIRED)

# Ortools
set(GFLAGS_USE_TARGET_NAMESPACE TRUE)
if(USE_ORTOOLS)
Expand All @@ -87,16 +97,6 @@ if(USE_XPRESS)
find_package(XPRESS REQUIRED)
endif()

# Sirius
if (USE_SIRIUS_SHARED)
set(SIRIUS_NAME sirius_solver)
else()
set(SIRIUS_NAME sirius_solver_static)
endif()

set(${SIRIUS_NAME}_ROOT ${CMAKE_CURRENT_BINARY_DIR}/external/sirius_solver CACHE PATH "Path where a Sirius installation already exists")
find_package(${SIRIUS_NAME} REQUIRED)

# SUITESPARSE
set(SUITESPARSE_HOME ${CMAKE_CURRENT_BINARY_DIR}/external/suitesparse CACHE PATH "Path where an SuiteSparse installation already exists")
find_package(SuiteSparse REQUIRED)
Expand Down
5 changes: 0 additions & 5 deletions metrix-simulator/cmake/tnr.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ function(check_files files_ expected_files_)
endforeach()
endfunction()

set(LD_LIBRARY_PATH_tmp $ENV{LD_LIBRARY_PATH})
set(ENV{LD_LIBRARY_PATH} $ENV{XPRESSDIR}/lib)

if (WITH_LODF_PTDF)
execute_process(COMMAND ${EXE} metrixOut.txt VariantSet.csv out 0 ${NB_TESTS} --write-PTDF --write-LODF WORKING_DIRECTORY ${WORKING_DIR} RESULT_VARIABLE cmd_result)
else()
Expand All @@ -53,8 +50,6 @@ endif()
file(GLOB test_output_files ${WORKING_DIR}/out_*)
file(GLOB expected_output_files ${EXPECTED_DIR}/out_*)

set(ENV{LD_LIBRARY_PATH} ${LD_LIBRARY_PATH_tmp})

check_files("${test_output_files}" "${expected_output_files}")

if(ALL_RESULTS)
Expand Down
Loading