Skip to content

Commit

Permalink
Add centos C++ artifacts (#26)
Browse files Browse the repository at this point in the history
* add centos.yml
* use new sirius assets from release https://github.com/rte-france/sirius-solver/releases
  • Loading branch information
sgatto authored Apr 7, 2022
1 parent a4b011f commit 8dd748f
Show file tree
Hide file tree
Showing 4 changed files with 213 additions and 170 deletions.
68 changes: 0 additions & 68 deletions .github/workflows/build-sirius/action.yml

This file was deleted.

165 changes: 165 additions & 0 deletions .github/workflows/centos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
name: CentOS

on:
push:
branches:
- main
- feature/*
- merge*
- fix/*
release:
types: [ created ]

env:
GITHUB_TOKEN: ${{ github.token }}

jobs:

build:
name: shrd=${{ matrix.shared }} sirius=${{ matrix.sirius }} xprs=${{ matrix.xprs }} extras=${{ matrix.extras }} java=${{ matrix.java }} dotnet=${{ matrix.dotnet }} python=${{ matrix.python }}-${{ matrix.python-version }}
runs-on: ubuntu-latest
container: 'centos:centos7'
env:
SIRIUS_RELEASE_TAG: antares-integration-v1.0
XPRESS_INSTALL_DIR: xpressmp813/
SIRIUS_INSTALL_DIR: sirius_install/
strategy:
fail-fast: false
matrix:
xprs: [ON]
sirius: [ON, OFF]
shared: [ON, OFF]
extras: [OFF]
exclude:
- xprs: OFF
sirius: OFF
include:
- extras: OFF
python: OFF
publish-or: ON
java: OFF
dotnet: OFF

steps:
- name: set name variables
id: names
shell: bash
run: |
SHARED=${{ matrix.shared }}
[ $SHARED == "ON" ] && WITH_SHARED="_shared" || WITH_SHARED="_static"
XPRS=${{ matrix.xprs }}
[ $XPRS == "ON" ] && WITH_XPRS="_xprs" || WITH_XPRS=""
SIRIUS=${{ matrix.sirius }}
[ $SIRIUS == "ON" ] && WITH_SIRIUS="_sirius" || WITH_SIRIUS=""
OS="_centos7"
APPENDIX="${OS}${WITH_SIRIUS}${WITH_XPRS}"
echo "::set-output name=appendix::$APPENDIX"
APPENDIX_WITH_SHARED="${OS}${WITH_SHARED}${WITH_SIRIUS}${WITH_XPRS}"
echo "::set-output name=appendix_with_shared::$APPENDIX_WITH_SHARED"
- uses: nelonoel/branch-name@v1.0.1

- name: is release created
run: |
release_created=${{ github.event_name == 'release' && github.event.action == 'created' }}
echo "RELEASE_CREATED=$release_created" >> $GITHUB_ENV
- name: Get release
if: ${{ env.RELEASE_CREATED == 'true' }}
id: get_release
uses:
bruceadams/get-release@v1.2.3

- name: install requirements
run: |
yum install -y epel-release
yum install -y git redhat-lsb-core make wget centos-release-scl scl-utils rpm-build
yum install -y cmake3 devtoolset-9
- name: Checkout OR-Tools
run: |
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b ${BRANCH_NAME} .
- name: Checkout Xpress linux
run: |
git clone https://${{ secrets.ACCESS_TOKEN }}@github.com/rte-france/xpress-mp.git ${{ env.XPRESS_INSTALL_DIR }}
- name: set Xpress variables
run: |
cd ${{ env.XPRESS_INSTALL_DIR }}
echo "XPRESSDIR=$PWD" >> $GITHUB_ENV
echo "XPRESS=$PWD/bin" >> $GITHUB_ENV
echo "XPRESS_LIB=$PWD/lib" >> $GITHUB_ENV
- name: Download Sirius
run: |
zipfile=centos-7_sirius-solver.zip
wget https://github.com/rte-france/sirius-solver/releases/download/${{ env.SIRIUS_RELEASE_TAG }}/$zipfile
unzip $zipfile
mv centos-7_sirius-solver-install ${{ env.SIRIUS_INSTALL_DIR }}
- name: set Sirius variables
run: |
cd ${{ env.SIRIUS_INSTALL_DIR }}
echo "SIRIUS=$PWD/lib" >> $GITHUB_ENV
echo "SIRIUS_CMAKE_DIR=$PWD/cmake" >> $GITHUB_ENV
- name: Configure OR-Tools
run: |
source /opt/rh/devtoolset-9/enable
cmake3 -S . -B build -DBUILD_SAMPLES=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="build/install" -DBUILD_SHARED_LIBS=${{ matrix.shared }} -DBUILD_DEPS=ON -DUSE_SIRIUS=${{ matrix.sirius }} -Dsirius_solver_DIR="${{ env.SIRIUS_CMAKE_DIR }}" -DUSE_XPRESS=${{ matrix.xprs }} -DXPRESS_ROOT="${{ env.XPRESSDIR }}" -DBUILD_PYTHON=${{ matrix.python }} -DBUILD_JAVA=${{ matrix.java }} -DBUILD_DOTNET=${{ matrix.dotnet }}
- name: Build OR-Tools Linux
run: |
source /opt/rh/devtoolset-9/enable
cmake3 --build build --config Release --target all install -j4
- name: Prepare OR-Tools install
if: ${{ matrix.publish-or == 'ON' }}
id: or-install
run: |
find build/install/bin -type f ! \( -name 'protoc*' -o -name 'scip' -o -name 'fz' \) -delete
cd build
ARCHIVE_NAME="ortools_cxx${{ steps.names.outputs.appendix_with_shared }}.zip"
ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}"
zip -r $ARCHIVE_PATH ./install
echo "::set-output name=archive_name::$ARCHIVE_NAME"
echo "::set-output name=archive_path::$ARCHIVE_PATH"
- name: Upload OR-Tools install artifact
uses: actions/upload-artifact@v2
if: ${{ matrix.publish-or == 'ON' }}
with:
name: ${{ steps.or-install.outputs.archive_name }}
path: ${{ steps.or-install.outputs.archive_path }}

- name: Publish OR-Tools install asset
if: ${{ env.RELEASE_CREATED == 'true' && matrix.publish-or == 'ON' }}
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ steps.or-install.outputs.archive_path }}
asset_name: ${{ steps.or-install.outputs.archive_name }}
asset_content_type: application/zip

- name: Run sirius_interface unittests
if: ${{ matrix.sirius == 'ON' }}
run: |
cd build
ctest3 -V -C Release -R 'cxx_unittests_sirius_interface'
- name: Run xpress_interface unittests
if: ${{ matrix.xprs == 'ON' }}
run: |
cd build
ctest3 -V -C Release -R 'cxx_unittests_xpress_interface'
- name: Run specific cpp tests
run: |
cd build
ctest3 -V -C Release -R 'cxx_cpp_linear_programming'
- name: Run other cpp tests
run: |
cd build
ctest3 --output-on-failure -C Release -R cxx_cpp -E 'cxx_cpp_linear_programming'
18 changes: 2 additions & 16 deletions .github/workflows/setup-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,30 @@ inputs:
description: 'should install dotnet ON OFF'
required: false
default: 'OFF'
python:
description: 'should install python'
required: false
default: 'ON'
runs:
using: "composite"
steps:
- name: Display Python path
shell: bash
run: which python

- name: install zip for windows
- name: install zip wget for windows
if: ${{ startsWith(inputs.os, 'windows') }}
shell: cmd
run: |
choco install zip --no-progress
choco install zip wget --no-progress
- name: Setup .NET 6.0
if: ${{ inputs.dotnet == 'ON' }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Set up Python
if: ${{ inputs.python == 'ON' }}
uses: actions/setup-python@v3
with:
python-version: ${{ inputs.python-version }}
architecture: x64
- name: Pip install reqs
if: ${{ inputs.python == 'ON' }}
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install mypy-protobuf absl-py setuptools wheel numpy pandas virtualenv
- name: Display Python path
shell: bash
run: which python

- name: Install SWIG 4.0.2 for windows
if: ${{ startsWith(inputs.os, 'windows') }}
shell: pwsh
Expand Down
Loading

0 comments on commit 8dd748f

Please sign in to comment.