diff --git a/.github/workflows/centos.yml b/.github/workflows/centos.yml index 2373508..36d532a 100644 --- a/.github/workflows/centos.yml +++ b/.github/workflows/centos.yml @@ -24,29 +24,15 @@ 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 @@ -67,26 +53,6 @@ jobs: id: branch-names uses: tj-actions/branch-names@v8 - - name: Install requirements (yum) - run: | - sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo - sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo - sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo - yum install -y epel-release - yum install -y git redhat-lsb-core make wget centos-release-scl scl-utils python3 - sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo - sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo - sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo - yum install -y devtoolset-11 - python3 -m pip install --upgrade pip - python3 -m pip install dataclasses - - name: Setup cmake - run : | - wget --no-verbose "https://devin-depot.rte-france.com/repository/cmake/v3.27/cmake-3.27.0-linux-x86_64.sh" - chmod a+x cmake-3.*-linux-x86_64.sh - ./cmake-3.*-linux-x86_64.sh --prefix=/usr/local/ --skip-license - rm cmake-3.*-linux-x86_64.sh - - name: Checkout OR-Tools if: ${{ env.RELEASE_CREATED == 'false' }} run: | @@ -95,7 +61,7 @@ jobs: - name: Checkout OR-Tools if: ${{ env.RELEASE_CREATED == 'true' }} run: | - git clone $GITHUB_SERVER_URL/google/or-tools.git -b 'v9.10' . + git clone $GITHUB_SERVER_URL/google/or-tools.git -b 'stable' . - name: Checkout this repository run: | @@ -106,67 +72,22 @@ jobs: 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' }} + 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: | - 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 - run: | - source /opt/rh/devtoolset-11/enable - cmake --build build --config Release --target all install -j4 - - - 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 - run: | - cd build - ctest -V -C Release --output-on-failure -R "sirius" + container_id=\$(docker create centos:shared-${{ matrix.shared }}-sirius-${{ matrix.sirius }}) + rm -rf ./install + docker cp \$container_id:/home/project/build/install ./install + docker rm \$container_id - name: Prepare OR-Tools install id: or-install diff --git a/.github/workflows/oracle.yml b/.github/workflows/oracle.yml index 9261b97..c61d7cb 100644 --- a/.github/workflows/oracle.yml +++ b/.github/workflows/oracle.yml @@ -113,7 +113,7 @@ jobs: uses: actions/checkout@v4 with: repository: google/or-tools - ref: 'v9.10' + ref: 'stable' - name: Checkout this repository uses: actions/checkout@v4 diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index f64b0e7..9d4fc18 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -57,7 +57,7 @@ jobs: uses: actions/checkout@v4 with: repository: google/or-tools - ref: 'v9.10' + ref: 'stable' - name: Checkout this repository uses: actions/checkout@v4 diff --git a/.github/workflows/windows-cpp.yml b/.github/workflows/windows-cpp.yml index 193a180..d6c649c 100644 --- a/.github/workflows/windows-cpp.yml +++ b/.github/workflows/windows-cpp.yml @@ -48,7 +48,7 @@ jobs: uses: actions/checkout@v4 with: repository: google/or-tools - ref: 'v9.10' + ref: 'stable' - name: Checkout this repository uses: actions/checkout@v4 diff --git a/.github/workflows/windows-python.yml b/.github/workflows/windows-python.yml index 689d638..3f499ea 100644 --- a/.github/workflows/windows-python.yml +++ b/.github/workflows/windows-python.yml @@ -50,7 +50,7 @@ jobs: uses: actions/checkout@v4 with: repository: google/or-tools - ref: 'v9.10' + ref: 'stable' - name: Checkout this repository uses: actions/checkout@v4