Skip to content

Commit

Permalink
Fix CI, change CentOS and use google stable for release (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgatto authored Jul 22, 2024
1 parent 7903924 commit daf84b1
Show file tree
Hide file tree
Showing 11 changed files with 201 additions and 346 deletions.
148 changes: 42 additions & 106 deletions .github/workflows/centos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,151 +25,87 @@ env:
jobs:

build:
name: shrd=${{ matrix.shared }} sirius=${{ matrix.sirius }} extras=${{ matrix.extras }} java=${{ matrix.java }} dotnet=${{ matrix.dotnet }} python=${{ matrix.python }}-${{ matrix.python-version }}
name: shrd=${{ matrix.shared }} sirius=${{ matrix.sirius }}
runs-on: ubuntu-latest
container: 'centos:centos7'
env:
SIRIUS_RELEASE_TAG: antares-integration-v1.4
XPRESS_INSTALL_DIR: xpressmp
strategy:
fail-fast: false
matrix:
sirius: [ON, OFF]
shared: [ON, OFF]
extras: [OFF]
include:
- extras: OFF
python: OFF
java: OFF
dotnet: OFF
- sirius: ON
shared: OFF
extras: OFF
python: OFF
java: OFF
dotnet: OFF

steps:
- name: set name variables
id: names
run: |
SHARED=${{ matrix.shared }}
[ $SHARED == "ON" ] && WITH_SHARED="_shared" || WITH_SHARED="_static"
SIRIUS=${{ matrix.sirius }}
[ $SIRIUS == "ON" ] && WITH_SIRIUS="_sirius" || WITH_SIRIUS=""
OS="_centos7"
APPENDIX="${OS}${WITH_SIRIUS}"
APPENDIX_WITH_SHARED="${OS}${WITH_SHARED}${WITH_SIRIUS}"
echo "appendix=$APPENDIX" >> $GITHUB_OUTPUT
echo "appendix_with_shared=$APPENDIX_WITH_SHARED" >> $GITHUB_OUTPUT
# Fill variable ${BRANCH_NAME}
- uses: nelonoel/[email protected]

- name: Install requirements (yum)
run: |
yum install -y epel-release
yum install -y git redhat-lsb-core make wget centos-release-scl scl-utils python3
yum install -y devtoolset-11
python3 -m pip install --upgrade pip
python3 -m pip install dataclasses
- name: Setup cmake
uses: jwlawson/[email protected]
- name: Checkout or-tools rte-france
if: ${{ env.RELEASE_CREATED == 'false' }}
uses: actions/checkout@v4
with:
cmake-version: '3.22.x'
repository: rte-france/or-tools
ref: ${{ github.event.inputs.rtefrance_ortools_branch || 'main' }}

- name: Checkout OR-Tools
run: |
git clone $GITHUB_SERVER_URL/rte-france/or-tools.git -b '${{ github.event.inputs.rtefrance_ortools_branch || 'main' }}' .
- name: Checkout or-tools google
if: ${{ env.RELEASE_CREATED == 'true' }}
uses: actions/checkout@v4
with:
repository: google/or-tools
ref: 'stable'

- name: Checkout this repository
run: |
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b ${BRANCH_NAME} "patch"
uses: actions/checkout@v4
with:
path: "patch"

- name: Apply patch
run: |
cp -r patch/* .
python3 patch.py
- name: Set-up Xpress from wheel
- name: Build inside docker
run: |
python3 -m pip install --upgrade pip
mkdir xpress
cd xpress
python3 -m pip download --only-binary=:all: --python-version 310 "xpress>=9.2,<9.3"
unzip xpr*.whl
XPRESS_DIR=$PWD/xpress
echo "XPRESSDIR=$XPRESS_DIR" >> $GITHUB_ENV
echo "XPAUTH_PATH=$XPRESS_DIR/license/community-xpauth.xpr" >> $GITHUB_ENV
ln -s $XPRESS_DIR/lib/libxprs.so.42 $XPRESS_DIR/lib/libxprs.so
- name: Download Sirius
if : ${{ matrix.sirius == 'ON' }}
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 sirius_install
echo "LD_LIBRARY_PATH=$PWD/sirius_install/lib" >> $GITHUB_ENV
echo "SIRIUS_CMAKE_DIR=$PWD/sirius_install/cmake" >> $GITHUB_ENV
- name: Configure OR-Tools
run: |
source /opt/rh/devtoolset-11/enable
cmake --version
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=${{ matrix.shared }} \
-DBUILD_PYTHON=${{ matrix.python }} \
-DBUILD_JAVA=${{ matrix.java }} \
-DBUILD_DOTNET=${{ matrix.dotnet }} \
-DBUILD_EXAMPLES=${{ env.RELEASE_CREATED == 'true' && 'OFF' || 'ON' }} \
-DBUILD_DEPS=ON \
-DUSE_SIRIUS=${{ matrix.sirius }} \
-Dsirius_solver_DIR="${{ env.SIRIUS_CMAKE_DIR }}" \
-DCMAKE_INSTALL_PREFIX="build/install" \
-DBUILD_SAMPLES=OFF \
-DBUILD_FLATZINC=OFF
- name: Build OR-Tools Linux
docker build \
--target build \
-t centos:shared-${{ matrix.shared }}-sirius-${{ matrix.sirius }} \
--build-arg="SIRIUS=${{ matrix.sirius }}" \
--build-arg="SHARED=${{ matrix.shared }}" \
--build-arg="SIRIUS_RELEASE_TAG=${{ env.SIRIUS_RELEASE_TAG }}" \
-f docker/centos.dockerfile .
- name: retrieve install from docker
run: |
source /opt/rh/devtoolset-11/enable
cmake --build build --config Release --target all install -j4
container_id=$(docker create centos:shared-${{ matrix.shared }}-sirius-${{ matrix.sirius }})
rm -rf ./install
docker cp $container_id:/home/project/install ./install
docker rm $container_id
- name: run tests not xpress
if: ${{ matrix.shared == 'ON' }}
run: |
cd build
ctest -C Release --output-on-failure -E "_xpress"
- name: run tests xpress
run: |
cd build
ctest -V -C Release --output-on-failure -R "_xpress"
- name: run tests sirius
- name: set name variables
id: names
run: |
cd build
ctest -V -C Release --output-on-failure -R "sirius"
SHARED=${{ matrix.shared }}
[ $SHARED == "ON" ] && WITH_SHARED="_shared" || WITH_SHARED="_static"
SIRIUS=${{ matrix.sirius }}
[ $SIRIUS == "ON" ] && WITH_SIRIUS="_sirius" || WITH_SIRIUS=""
OS="_centos7"
APPENDIX="${OS}${WITH_SIRIUS}"
APPENDIX_WITH_SHARED="${OS}${WITH_SHARED}${WITH_SIRIUS}"
echo "appendix=$APPENDIX" >> $GITHUB_OUTPUT
echo "appendix_with_shared=$APPENDIX_WITH_SHARED" >> $GITHUB_OUTPUT
- name: Prepare OR-Tools install
id: or-install
run: |
cd build
ARCHIVE_NAME="ortools_cxx${{ steps.names.outputs.appendix_with_shared }}.zip"
ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}"
zip -r $ARCHIVE_PATH ./install
echo "archive_name=$ARCHIVE_NAME" >> $GITHUB_OUTPUT
echo "archive_path=$ARCHIVE_PATH" >> $GITHUB_OUTPUT
- name: Upload OR-Tools install artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
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' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.or-install.outputs.archive_path }}
16 changes: 12 additions & 4 deletions .github/workflows/oracle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,24 @@ jobs:
python3 -m pip install protobuf mypy-protobuf absl-py setuptools wheel pandas virtualenv
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.13
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.26.x'

- name: Checkout or-tools
if: ${{ env.RELEASE_CREATED == 'false' }}
uses: actions/checkout@v4
with:
repository: rte-france/or-tools
ref: ${{ github.event.inputs.rtefrance_ortools_branch || 'main' }}

- name: Checkout or-tools
if: ${{ env.RELEASE_CREATED == 'true' }}
uses: actions/checkout@v4
with:
repository: google/or-tools
ref: 'stable'

- name: Checkout this repository
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -192,7 +200,7 @@ jobs:
path: ${{ steps.or-install.outputs.archive_path }}
- name: Publish OR-Tools install asset
if: ${{ env.RELEASE_CREATED == 'true' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.or-install.outputs.archive_path }}

Expand All @@ -217,7 +225,7 @@ jobs:
path: ${{ steps.wheel.outputs.archive_path }}
- name: Publish OR-Tools wheel asset
if: ${{ matrix.cmake.python == 'ON' && env.RELEASE_CREATED == 'true' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.wheel.outputs.archive_path }}

Expand Down Expand Up @@ -248,6 +256,6 @@ jobs:
path: ${{ steps.jar.outputs.archive_path }}
- name: Publish OR-Tools jar asset
if: ${{ matrix.cmake.java == 'ON' && env.RELEASE_CREATED == 'true' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.jar.outputs.archive_path }}
26 changes: 14 additions & 12 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,26 @@ jobs:
sirius-release-tag: [antares-integration-v1.4]
steps:
- name: Checkout or-tools
if: ${{ env.RELEASE_CREATED == 'false' }}
uses: actions/checkout@v4
with:
repository: rte-france/or-tools
ref: ${{ github.event.inputs.rtefrance_ortools_branch || 'main' }}

- name: Checkout or-tools
if: ${{ env.RELEASE_CREATED == 'true' }}
uses: actions/checkout@v4
with:
repository: google/or-tools
ref: 'stable'

- name: Checkout this repository
uses: actions/checkout@v4
with:
path: "patch"

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.cmake.python-version }}

Expand All @@ -85,7 +93,7 @@ jobs:
run: >
python -m pip install absl-py mypy mypy-protobuf
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.13
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.26.x'

Expand Down Expand Up @@ -188,12 +196,6 @@ jobs:
APPENDIX_WITH_SHARED="${OS}${WITH_SHARED}${WITH_SIRIUS}"
echo "appendix_with_shared=$APPENDIX_WITH_SHARED" >> $GITHUB_OUTPUT
- name: Get release
if: ${{ env.RELEASE_CREATED == 'true' }}
id: get_release
uses:
bruceadams/[email protected]

- name: Prepare OR-Tools install
if: ${{ matrix.cmake.publish-cxx-or == 'ON' }}
id: or-install
Expand All @@ -214,7 +216,7 @@ jobs:
path: ${{ steps.or-install.outputs.archive_path }}
- name: Publish OR-Tools install asset
if: ${{ env.RELEASE_CREATED == 'true' && matrix.cmake.publish-cxx-or == 'ON' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.or-install.outputs.archive_path }}

Expand All @@ -241,7 +243,7 @@ jobs:
path: ${{ steps.wheel.outputs.archive_path }}
- name: Publish OR-Tools wheel asset
if: ${{ env.RELEASE_CREATED == 'true' && matrix.cmake.python == 'ON' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.wheel.outputs.archive_path }}

Expand All @@ -268,7 +270,7 @@ jobs:
path: ${{ steps.jar.outputs.archive_path }}
- name: Publish OR-Tools jar asset
if: ${{ env.RELEASE_CREATED == 'true' && matrix.cmake.java == 'ON' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.jar.outputs.archive_path }}

Expand Down Expand Up @@ -296,6 +298,6 @@ jobs:
path: ${{ steps.dotnet.outputs.archive_path }}
- name: Publish OR-Tools dotnet asset
if: ${{ env.RELEASE_CREATED == 'true' && matrix.cmake.dotnet == 'ON' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.dotnet.outputs.archive_path }}
18 changes: 10 additions & 8 deletions .github/workflows/windows-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,26 @@ jobs:
sirius-release-tag: [ antares-integration-v1.4 ]
steps:
- name: Checkout or-tools
if: ${{ env.RELEASE_CREATED == 'false' }}
uses: actions/checkout@v4
with:
repository: rte-france/or-tools
ref: ${{ github.event.inputs.rtefrance_ortools_branch || 'main' }}

- name: Checkout or-tools
if: ${{ env.RELEASE_CREATED == 'true' }}
uses: actions/checkout@v4
with:
repository: google/or-tools
ref: 'stable'

- name: Checkout this repository
uses: actions/checkout@v4
with:
path: "patch"

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"

Expand Down Expand Up @@ -143,12 +151,6 @@ jobs:
APPENDIX_WITH_SHARED="${OS}${WITH_SHARED}${WITH_SIRIUS}"
echo "appendix_with_shared=$APPENDIX_WITH_SHARED" >> $GITHUB_OUTPUT
- name: Get release
if: ${{ env.RELEASE_CREATED == 'true' }}
id: get_release
uses:
bruceadams/[email protected]

- name: install zip
shell: cmd
run: |
Expand All @@ -171,6 +173,6 @@ jobs:
path: ${{ steps.or-install.outputs.archive_path }}
- name: Publish OR-Tools install asset
if: ${{ env.RELEASE_CREATED == 'true' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: build/${{ steps.or-install.outputs.archive_name }}
Loading

0 comments on commit daf84b1

Please sign in to comment.