forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add centos.yml * use new sirius assets from release https://github.com/rte-france/sirius-solver/releases
- Loading branch information
Showing
4 changed files
with
213 additions
and
170 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.