Skip to content

Commit

Permalink
review build option and update antares solver version to 8.1.0 (#256)
Browse files Browse the repository at this point in the history
* update antares-solver to 8.1.0

* add sirius and or-tools compilation with antares-solver is build

* don't build all not system libs with antares-solver

* add CI to test build with deps. build and not precompiled deps

* review not needed options

* add antares-version.json to docker publish condition

* set CMAKE_TOOLCHAIN_FILE as absolute only if defined

* correction test on antares-solver build

* add endline to force docker publish

* cmake policy to define option for BUILD_ortools

* don't ask for antares solver build when using pre compiled archive

* add endpoint-repo for git2 install

* add libuuid-devel for antares-solver compilation

* update docker and github action to install rh-git227-git

* add comment for git 2.x enable in centos7
  • Loading branch information
jmkerloch authored Oct 12, 2021
1 parent d40f528 commit 054c081
Show file tree
Hide file tree
Showing 15 changed files with 363 additions and 26 deletions.
107 changes: 107 additions & 0 deletions .github/workflows/centos7-system-deps-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Centos7 CI (system libs + deps. build)

on:
push:
branches:
- main
- develop
- release/*
jobs:

build:

runs-on: ubuntu-latest
container: 'centos:7'

steps:

- name: Set up Python
run: |
yum update -y
yum install -y python3 python3-pip
pip3 install --upgrade pip
- name: Install libraries
run: |
yum install -y wget git epel-release redhat-lsb-core gcc gcc-c++ make centos-release-scl scl-utils
yum install -y jsoncpp-devel gtest-devel openmpi-devel boost-openmpi-devel doxygen graphviz boost-program-options
yum install -y cmake3 devtoolset-7 environment-modules rpm-build zlib-devel
yum install -y rh-git227-git
yum install -y libuuid-devel
- uses: nelonoel/[email protected]

- name: Checkout
run: |
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b ${BRANCH_NAME} .
- name: Read antares-xpansion version
id: antares-xpansion-version
uses: notiz-dev/github-action-json-property@release
with:
path: 'antares-version.json'
prop_path: 'antares_xpansion_version'

- name: Init submodule
run: |
git submodule update --init --recursive .
- name: Install dependencies
run: |
pip3 install -r requirements-tests.txt
- name: Configure
run: |
source /opt/rh/devtoolset-7/enable
#git 2.x must be enabled for Coin compilation with CMake ExternalProject_Add
source /opt/rh/rh-git227/enable
export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH
export PATH=/usr/lib64/openmpi/bin:$PATH
cmake3 -B _build -S . -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DUSE_MPI=ON -DCMAKE_INSTALL_PREFIX=_install
- name: Build
run: |
source /opt/rh/devtoolset-7/enable
source /opt/rh/rh-git227/enable
export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH
export PATH=/usr/lib64/openmpi/bin:$PATH
cmake3 --build _build --config Release -j2 --target install
- name: Running unit tests
run: |
cd _build
ctest3 -C Release --output-on-failure -L "unit|benders"
- id: create-single-file
name: Single file .tar.gz creation
uses: ./.github/workflows/single-file-creation-tgz
with:
antares-xpansion-version: ${{steps.antares-xpansion-version.outputs.prop}}

- name: Installer .rpm creation
run: |
cd _build
cpack3 -G RPM
- name: Installer .tar.gz creation
run: |
cd _build
cpack3 -G TGZ
- name: Installer archive upload
uses: actions/upload-artifact@v2
with:
name: antares-xpansion-centos7-archive
path: _build/*.tar.gz

- name: Installer rpm upload
uses: actions/upload-artifact@v2
with:
name: antares-xpansion-centos7-rpm
path: _build/*.rpm

- name: Single file upload
uses: actions/upload-artifact@v2
with:
name: antares-xpansion-centos-single-file
path: ${{ steps.create-single-file.outputs.archive-path }}
3 changes: 2 additions & 1 deletion .github/workflows/centos7-system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
with:
files: |
docker/centos7
antares-version.json
- name: Read antares-solver version
id: antares-version
Expand Down Expand Up @@ -96,7 +97,7 @@ jobs:
source /opt/rh/devtoolset-7/enable
export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH
export PATH=/usr/lib64/openmpi/bin:$PATH
cmake3 -B _build -S . -DDEPS_INSTALL_DIR=/rte-antares-deps-Release -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DUSE_SEQUENTIAL=true -DUSE_MPI=true -DCMAKE_INSTALL_PREFIX=_install -DBUILD_not_system=OFF
cmake3 -B _build -S . -DDEPS_INSTALL_DIR=/rte-antares-deps-Release -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DUSE_MPI=ON -DCMAKE_INSTALL_PREFIX=_install -DBUILD_not_system=OFF -DBUILD_antares_solver=OFF
- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/centos7-system_boost_1_75.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
source /opt/rh/devtoolset-7/enable
export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH
export PATH=/usr/lib64/openmpi/bin:$PATH
cmake3 -B _build -S . -DDEPS_INSTALL_DIR=rte-antares-deps-Release -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DUSE_SEQUENTIAL=true -DUSE_MPI=true -DCMAKE_PREFIX_PATH=./opt/boost_1_75_0 -DCMAKE_INSTALL_PREFIX=_install -DBUILD_not_system=OFF
cmake3 -B _build -S . -DDEPS_INSTALL_DIR=rte-antares-deps-Release -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DUSE_MPI=ON -DCMAKE_PREFIX_PATH=./opt/boost_1_75_0 -DCMAKE_INSTALL_PREFIX=_install -DBUILD_not_system=OFF -DBUILD_antares_solver=OFF
- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/releases-centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
source /opt/rh/devtoolset-7/enable
export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH
export PATH=/usr/lib64/openmpi/bin:$PATH
cmake3 -B _build -S . -DDEPS_INSTALL_DIR=/rte-antares-deps-Release -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DUSE_SEQUENTIAL=true -DUSE_MPI=true -DCMAKE_INSTALL_PREFIX=_install -DBUILD_not_system=OFF
cmake3 -B _build -S . -DDEPS_INSTALL_DIR=/rte-antares-deps-Release -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DUSE_MPI=ON -DCMAKE_INSTALL_PREFIX=_install -DBUILD_not_system=OFF -DBUILD_antares_solver=OFF
- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/releases-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
- name: Configure
run: |
cmake -B _build -S . -DDEPS_INSTALL_DIR=rte-antares-deps-Release -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DUSE_SEQUENTIAL=true -DUSE_MPI=true -DCMAKE_INSTALL_PREFIX=_install -DBUILD_not_system=OFF
cmake -B _build -S . -DDEPS_INSTALL_DIR=rte-antares-deps-Release -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DUSE_MPI=ON -DCMAKE_INSTALL_PREFIX=_install -DBUILD_not_system=OFF -DBUILD_antares_solver=OFF
- name: Build
run: |
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/releases-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ jobs:
strategy:
matrix:
os: [windows-latest]
include:
- os: windows-latest
triplet: x64-windows
triplet: [x64-windows]

env:
# Indicates the location of the vcpkg as a Git submodule of the project repository.
Expand Down Expand Up @@ -107,7 +105,7 @@ jobs:
- name: Configure with VCPKG
run: |
$pwd=Get-Location
cmake -B _build -S . -DDEPS_INSTALL_DIR=rte-antares-deps-Release -DCMAKE_PREFIX_PATH="$pwd\rte-antares-${{steps.antares-version.outputs.prop}}-installer-64bits" -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DUSE_SEQUENTIAL=true -DUSE_MPI=true -DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_INSTALL_PREFIX=_install -DBUILD_not_system=OFF
cmake -B _build -S . -DDEPS_INSTALL_DIR=rte-antares-deps-Release -DCMAKE_PREFIX_PATH="$pwd\rte-antares-${{steps.antares-version.outputs.prop}}-installer-64bits" -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DUSE_MPI=ON -DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_INSTALL_PREFIX=_install -DBUILD_not_system=OFF -DBUILD_antares_solver=OFF
- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
- name: Configure
run: |
cmake -B _build -S . -DDEPS_INSTALL_DIR=rte-antares-deps-Debug -DCODE_COVERAGE=ON -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Debug -DUSE_SEQUENTIAL=true -DUSE_MPI=true -DCMAKE_INSTALL_PREFIX=_install -DBUILD_not_system=OFF
cmake -B _build -S . -DDEPS_INSTALL_DIR=rte-antares-deps-Debug -DCODE_COVERAGE=ON -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Debug -DUSE_MPI=ON -DCMAKE_INSTALL_PREFIX=_install -DBUILD_not_system=OFF -DBUILD_antares_solver=OFF
- name: Build
run: build-wrapper-linux-x86-64 --out-dir $GITHUB_WORKSPACE/_build/output cmake --build _build --config Debug -j2
Expand Down
99 changes: 99 additions & 0 deletions .github/workflows/ubuntu-system-deps-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Ubuntu CI (system libs + deps. build)

on:
push:
branches:
- main
- develop
- feature/review_build_option
- release/*
jobs:

build:

runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
os: [ubuntu-20.04]

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: ccache
uses: hendrikmuhs/ccache-action@v1

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip3 install -r requirements-tests.txt
- name: Install libraries
run: |
sudo apt-get update --fix-missing
sudo apt-get install libjsoncpp-dev libgtest-dev libboost-mpi-dev libboost-program-options-dev
cd /usr/src/googletest/
sudo cmake .
sudo cmake --build . --target install
- name: Read antares-xpansion version
id: antares-xpansion-version
uses: notiz-dev/github-action-json-property@release
with:
path: 'antares-version.json'
prop_path: 'antares_xpansion_version'

- name: Configure
run: |
cmake -B _build -S . -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DUSE_MPI=ON -DCMAKE_INSTALL_PREFIX=_install
- name: Build
run: |
cmake --build _build --config Release -j2 --target install
- name: Running unit tests
run: |
cd _build
ctest -C Release --output-on-failure -L "medium|unit|benders|lpnamer"
- id: create-single-file
name: Single file .tar.gz creation
uses: ./.github/workflows/single-file-creation-tgz
with:
antares-xpansion-version: ${{steps.antares-xpansion-version.outputs.prop}}

- name: Installer .tar.gz creation
run: |
cd _build
cpack -G TGZ
- name: Installer .deb creation
run: |
cd _build
cpack -G DEB
- name: Installer upload
uses: actions/upload-artifact@v2
with:
name: antares-xpansion-ubuntu-archive
path: _build/*.tar.gz

- name: Deb Installer upload
uses: actions/upload-artifact@v2
with:
name: antares-xpansion-ubuntu-deb
path: _build/*.deb

- name: Single file upload
uses: actions/upload-artifact@v2
with:
name: antares-xpansion-ubuntu-single-file
path: ${{ steps.create-single-file.outputs.archive-path }}

8 changes: 3 additions & 5 deletions .github/workflows/ubuntu-system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: ccache
uses: hendrikmuhs/ccache-action@v1
Expand Down Expand Up @@ -71,14 +73,10 @@ jobs:
antares-version: ${{steps.antares-version.outputs.prop}}
os: ${{matrix.os}}
os-full-name: Ubuntu-20.04

- name: Init submodule
run: |
git submodule update --init --recursive .

- name: Configure
run: |
cmake -B _build -S . -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DDEPS_INSTALL_DIR=rte-antares-deps-Release -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DUSE_SEQUENTIAL=true -DUSE_MPI=true -DCMAKE_INSTALL_PREFIX=_install -DBUILD_not_system=OFF
cmake -B _build -S . -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DDEPS_INSTALL_DIR=rte-antares-deps-Release -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DUSE_MPI=ON -DCMAKE_INSTALL_PREFIX=_install -DBUILD_not_system=OFF -DBUILD_antares_solver=OFF
- name: Build
run: |
Expand Down
Loading

0 comments on commit 054c081

Please sign in to comment.