From f3221d44914a801b5f2f2d9a47f53e206485a473 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Mon, 19 Aug 2024 17:10:50 +0200 Subject: [PATCH 01/29] test 1 --- .github/workflows/windows-cpp.yml | 36 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/.github/workflows/windows-cpp.yml b/.github/workflows/windows-cpp.yml index 352b56c..aacc343 100644 --- a/.github/workflows/windows-cpp.yml +++ b/.github/workflows/windows-cpp.yml @@ -37,35 +37,31 @@ jobs: os: [windows-latest] 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@v5 with: python-version: "3.8" - - name: Apply patch + - name: set or-tools repo vars release + if: ${{ env.RELEASE_CREATED == 'true' }} + shell: bash + run: | + OR_REPO="https://github.com/google/or-tools" + OR_REF="stable" + echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV + echo "OR_REF=$OR_REF" >> $GITHUB_ENV + + - name: set or-tools repo vars not release + if: ${{ env.RELEASE_CREATED == 'false' }} shell: bash run: | - cp -r patch/ortools patch/patch.py patch/patch_utils.py . - python patch.py + OR_REPO="https://github.com/rte-france/or-tools" + OR_REF=${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} + echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV + echo "OR_REF=$OR_REF" >> $GITHUB_ENV - name: Set-up Xpress with pip shell: bash @@ -96,6 +92,8 @@ jobs: cmake -S. -Bbuild -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release + -Dortools_REPO=$OR_REPO + -Dortools_REF=$OR_REF -DBUILD_DEPS=ON -DBUILD_EXAMPLES=${{ env.RELEASE_CREATED == 'true' && 'OFF' || 'ON' }} -DBUILD_SAMPLES=OFF From 5c5171b5583aec2a45def6038b7db17c0aa65da6 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Mon, 19 Aug 2024 17:17:47 +0200 Subject: [PATCH 02/29] fix --- .github/workflows/windows-cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-cpp.yml b/.github/workflows/windows-cpp.yml index aacc343..04ed82e 100644 --- a/.github/workflows/windows-cpp.yml +++ b/.github/workflows/windows-cpp.yml @@ -92,8 +92,8 @@ jobs: cmake -S. -Bbuild -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release - -Dortools_REPO=$OR_REPO - -Dortools_REF=$OR_REF + -Dortools_REPO=${{ env.OR_REPO }} + -Dortools_REF=${{ env.OR_REF }} -DBUILD_DEPS=ON -DBUILD_EXAMPLES=${{ env.RELEASE_CREATED == 'true' && 'OFF' || 'ON' }} -DBUILD_SAMPLES=OFF From 959a0e569c0a2bc0e82648d73f081938f4042280 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Mon, 19 Aug 2024 17:23:15 +0200 Subject: [PATCH 03/29] fix --- .github/workflows/windows-cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-cpp.yml b/.github/workflows/windows-cpp.yml index 04ed82e..78f9608 100644 --- a/.github/workflows/windows-cpp.yml +++ b/.github/workflows/windows-cpp.yml @@ -49,7 +49,7 @@ jobs: if: ${{ env.RELEASE_CREATED == 'true' }} shell: bash run: | - OR_REPO="https://github.com/google/or-tools" + OR_REPO="https://github.com/google/or-tools.git" OR_REF="stable" echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV echo "OR_REF=$OR_REF" >> $GITHUB_ENV @@ -58,7 +58,7 @@ jobs: if: ${{ env.RELEASE_CREATED == 'false' }} shell: bash run: | - OR_REPO="https://github.com/rte-france/or-tools" + OR_REPO="https://github.com/rte-france/or-tools.git" OR_REF=${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV echo "OR_REF=$OR_REF" >> $GITHUB_ENV From 1d666cb5d2163f76a9a05b63c960c0822cd88368 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Tue, 20 Aug 2024 10:05:16 +0200 Subject: [PATCH 04/29] update ubuntu CI --- .github/workflows/ubuntu.yml | 37 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 073084e..bf6c81d 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -46,34 +46,31 @@ jobs: sirius: [ON, OFF] 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@v5 with: python-version: ${{ matrix.cmake.python-version }} - - name: Apply patch + - name: set or-tools repo vars release + if: ${{ env.RELEASE_CREATED == 'true' }} + shell: bash + run: | + OR_REPO="https://github.com/google/or-tools.git" + OR_REF="stable" + echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV + echo "OR_REF=$OR_REF" >> $GITHUB_ENV + + - name: set or-tools repo vars not release + if: ${{ env.RELEASE_CREATED == 'false' }} + shell: bash run: | - cp -r patch/ortools patch/patch.py patch/patch_utils.py . - python patch.py + OR_REPO="https://github.com/rte-france/or-tools.git" + OR_REF=${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} + echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV + echo "OR_REF=$OR_REF" >> $GITHUB_ENV - name: Install GCC10 and others shell: bash @@ -137,6 +134,8 @@ jobs: run: > cmake -S . -B build -DCMAKE_BUILD_TYPE=Release + -Dortools_REPO=${{ env.OR_REPO }} + -Dortools_REF=${{ env.OR_REF }} -DBUILD_SHARED_LIBS=${{ matrix.cmake.shared }} -DBUILD_PYTHON=${{ matrix.cmake.python }} -DBUILD_JAVA=${{ matrix.cmake.java }} From 6c19c8bec20be9981833aeae4413b98d527f78e7 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Tue, 20 Aug 2024 11:45:50 +0200 Subject: [PATCH 05/29] default to sirius off --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1955c14..3f66ecb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ set_if_not_defined(USE_GLPK "ON" CACHE INTERNAL "") set_if_not_defined(BUILD_SHARED_LIBS "OFF" CACHE INTERNAL "") # In mode optimization error analysis, we call Sirius through or-tools # So we need to activate Sirius in or-tools configuration (OFF by default) -set_if_not_defined(USE_SIRIUS "ON" CACHE INTERNAL "") +set_if_not_defined(USE_SIRIUS "OFF" CACHE INTERNAL "") FetchContent_MakeAvailable(ortools) find_package(ortools REQUIRED) From f59d851cfa102c0e1fc85f2be834d7a4df50426c Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Tue, 20 Aug 2024 12:06:25 +0200 Subject: [PATCH 06/29] temporary fix --- patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patch.py b/patch.py index b37f7c5..7af5907 100644 --- a/patch.py +++ b/patch.py @@ -38,7 +38,7 @@ # add the USE_SIRIUS configuration flag in deps.cmake full_patch.append(Addition( - Path.cwd()/'cmake'/'deps.cmake', + Path.cwd()/'cmake'/'system_deps.cmake', ''' if(USE_CPLEX) find_package(CPLEX REQUIRED) From b08fc2d8d16749efe4d7b57820a8f5afd718a7c5 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Tue, 20 Aug 2024 15:59:00 +0200 Subject: [PATCH 07/29] try fix --- .github/workflows/ubuntu.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index bf6c81d..d4f35c4 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -225,7 +225,7 @@ jobs: id: wheel shell: bash run: | - cd ./build/python/dist + cd ./build/_deps/ortools-build/python/dist MY_DIR="ortools_python-${{ matrix.cmake.python-version }}${{ steps.names.outputs.appendix }}" mkdir ${MY_DIR} cp *.whl "${MY_DIR}" @@ -252,7 +252,7 @@ jobs: id: jar shell: bash run: | - cd ./build/java + cd ./build/_deps/ortools-build/java MY_DIR="ortools_java${{ steps.names.outputs.appendix }}" mkdir ${MY_DIR} cp ortools-*/target/*.jar "${MY_DIR}" @@ -279,7 +279,7 @@ jobs: id: dotnet shell: bash run: | - cd ./build/dotnet/packages/ + cd ./build/_deps/ortools-build/dotnet/packages/ MY_DIR="ortools_dotnet${{ steps.names.outputs.appendix }}" mkdir ${MY_DIR} cp Google.OrTools.*.nupkg "${MY_DIR}" From ea394865955241cf82f39789e9cd81c0e7fdd616 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Thu, 22 Aug 2024 10:24:01 +0200 Subject: [PATCH 08/29] try fix --- .github/workflows/centos.yml | 2 +- .github/workflows/oracle.yml | 6 +++--- .github/workflows/ubuntu.yml | 2 +- .github/workflows/windows-cpp.yml | 2 +- .github/workflows/windows-python.yml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/centos.yml b/.github/workflows/centos.yml index 6c82936..cec2556 100644 --- a/.github/workflows/centos.yml +++ b/.github/workflows/centos.yml @@ -48,7 +48,7 @@ jobs: uses: actions/checkout@v4 with: repository: google/or-tools - ref: 'stable' + ref: 'v9.10' - name: Checkout this repository uses: actions/checkout@v4 diff --git a/.github/workflows/oracle.yml b/.github/workflows/oracle.yml index e7eb01a..9b0031e 100644 --- a/.github/workflows/oracle.yml +++ b/.github/workflows/oracle.yml @@ -114,7 +114,7 @@ jobs: uses: actions/checkout@v4 with: repository: google/or-tools - ref: 'stable' + ref: 'v9.10' - name: Checkout this repository uses: actions/checkout@v4 @@ -211,7 +211,7 @@ jobs: run: | MY_DIR="ortools_python-3.9${{ steps.names.outputs.appendix }}" mkdir $MY_DIR - cp build/python/dist/*.whl $MY_DIR + cp ./build/_deps/ortools-build/python/dist/*.whl $MY_DIR ARCHIVE_NAME="${MY_DIR}.zip" ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" zip -r ${ARCHIVE_PATH} ${MY_DIR} @@ -236,7 +236,7 @@ jobs: run: | MY_DIR="ortools_java${{ steps.names.outputs.appendix }}" mkdir ${MY_DIR} - cp build/java/ortools-*/target/*.jar $MY_DIR + cp ./build/_deps/ortools-build/java/ortools-*/target/*.jar $MY_DIR ARCHIVE_NAME="${MY_DIR}.zip" ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" df -h diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index d4f35c4..0f885a3 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -59,7 +59,7 @@ jobs: shell: bash run: | OR_REPO="https://github.com/google/or-tools.git" - OR_REF="stable" + OR_REF="v9.10" echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV echo "OR_REF=$OR_REF" >> $GITHUB_ENV diff --git a/.github/workflows/windows-cpp.yml b/.github/workflows/windows-cpp.yml index 78f9608..ce53c93 100644 --- a/.github/workflows/windows-cpp.yml +++ b/.github/workflows/windows-cpp.yml @@ -50,7 +50,7 @@ jobs: shell: bash run: | OR_REPO="https://github.com/google/or-tools.git" - OR_REF="stable" + OR_REF="v9.10" echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV echo "OR_REF=$OR_REF" >> $GITHUB_ENV diff --git a/.github/workflows/windows-python.yml b/.github/workflows/windows-python.yml index 8770982..e7bae69 100644 --- a/.github/workflows/windows-python.yml +++ b/.github/workflows/windows-python.yml @@ -149,7 +149,7 @@ jobs: id: wheel shell: bash run: | - cd ./build/python/dist + cd ./build/_deps/ortools-build/python/dist MY_DIR="ortools_python-${{ matrix.python.version }}${{ steps.names.outputs.appendix }}" mkdir ${MY_DIR} cp *.whl "${MY_DIR}" From c0e54002472a2a3974de774f3573a51a12c3f81c Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Thu, 22 Aug 2024 10:44:50 +0200 Subject: [PATCH 09/29] point to deps.cmake --- patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patch.py b/patch.py index 7af5907..b37f7c5 100644 --- a/patch.py +++ b/patch.py @@ -38,7 +38,7 @@ # add the USE_SIRIUS configuration flag in deps.cmake full_patch.append(Addition( - Path.cwd()/'cmake'/'system_deps.cmake', + Path.cwd()/'cmake'/'deps.cmake', ''' if(USE_CPLEX) find_package(CPLEX REQUIRED) From cca2ba3ed213e0279615a6155025742606b7010d Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Thu, 22 Aug 2024 14:08:44 +0200 Subject: [PATCH 10/29] try fix windows --- .github/workflows/windows-cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-cpp.yml b/.github/workflows/windows-cpp.yml index ce53c93..559d3b7 100644 --- a/.github/workflows/windows-cpp.yml +++ b/.github/workflows/windows-cpp.yml @@ -92,8 +92,8 @@ jobs: cmake -S. -Bbuild -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release - -Dortools_REPO=${{ env.OR_REPO }} - -Dortools_REF=${{ env.OR_REF }} + -Dortools_REPO="${{ env.OR_REPO }}" + -Dortools_REF="${{ env.OR_REF }}" -DBUILD_DEPS=ON -DBUILD_EXAMPLES=${{ env.RELEASE_CREATED == 'true' && 'OFF' || 'ON' }} -DBUILD_SAMPLES=OFF From 42f358e2986d15106ab111d583f2b54d360e648e Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Thu, 22 Aug 2024 14:09:04 +0200 Subject: [PATCH 11/29] update centos.yml --- .github/workflows/centos.yml | 35 +++++++++++++++++------------------ docker/centos.dockerfile | 4 ++++ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/workflows/centos.yml b/.github/workflows/centos.yml index cec2556..d7eb44e 100644 --- a/.github/workflows/centos.yml +++ b/.github/workflows/centos.yml @@ -36,29 +36,26 @@ jobs: shared: [ON, OFF] steps: - - name: Checkout or-tools rte-france - if: ${{ env.RELEASE_CREATED == 'false' }} + - name: Checkout this repository uses: actions/checkout@v4 - with: - repository: rte-france/or-tools - ref: ${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} - - name: Checkout or-tools google + - name: set or-tools repo vars release if: ${{ env.RELEASE_CREATED == 'true' }} - uses: actions/checkout@v4 - with: - repository: google/or-tools - ref: 'v9.10' - - - name: Checkout this repository - uses: actions/checkout@v4 - with: - path: "patch" + shell: bash + run: | + OR_REPO="https://github.com/google/or-tools.git" + OR_REF="v9.10" + echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV + echo "OR_REF=$OR_REF" >> $GITHUB_ENV - - name: Apply patch + - name: set or-tools repo vars not release + if: ${{ env.RELEASE_CREATED == 'false' }} + shell: bash run: | - cp -r patch/ortools patch/patch.py patch/patch_utils.py . - python3 patch.py + OR_REPO="https://github.com/rte-france/or-tools.git" + OR_REF=${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} + echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV + echo "OR_REF=$OR_REF" >> $GITHUB_ENV - name: Build inside docker run: | @@ -69,6 +66,8 @@ jobs: --build-arg="SIRIUS=${{ matrix.sirius }}" \ --build-arg="SHARED=${{ matrix.shared }}" \ --build-arg="SIRIUS_RELEASE_TAG=${{ env.SIRIUS_RELEASE_TAG }}" \ + --build-arg="OR_REPO=${{ env.OR_REPO }}" \ + --build-arg="OR_REF=${{ env.OR_REF }}" \ -f docker/centos.dockerfile . - name: retrieve install from docker diff --git a/docker/centos.dockerfile b/docker/centos.dockerfile index eb7453c..cda9f72 100644 --- a/docker/centos.dockerfile +++ b/docker/centos.dockerfile @@ -55,10 +55,14 @@ FROM base AS devel ARG SIRIUS=OFF ARG SHARED=ON ARG BUILD_EXAMPLES=OFF +ARG OR_REPO="https://github.com/rte-france/or-tools.git" +ARG OR_REF="stable" WORKDIR /home/project COPY . . FROM devel AS build RUN cmake -S. -Bbuild \ + -Dortools_REPO=${OR_REPO} \ + -Dortools_REF=${OR_REF} \ -DBUILD_DEPS=ON \ -DBUILD_SHARED_LIBS=${SHARED} \ -DUSE_SIRIUS=${SIRIUS}\ From bc7f6525e2ad3ff3cc1575e9a90ecb7e68d1a864 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Thu, 22 Aug 2024 14:30:31 +0200 Subject: [PATCH 12/29] fix centos.yml --- .github/workflows/centos.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/centos.yml b/.github/workflows/centos.yml index d7eb44e..838c93f 100644 --- a/.github/workflows/centos.yml +++ b/.github/workflows/centos.yml @@ -59,7 +59,6 @@ jobs: - name: Build inside docker run: | - cp -r patch/docker . docker build \ --target build \ -t centos:shared-${{ matrix.shared }}-sirius-${{ matrix.sirius }} \ From 309265855fe0a844edf73f3a658287505205d43e Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Thu, 22 Aug 2024 14:34:17 +0200 Subject: [PATCH 13/29] new ci style for oracle.yml and windows-python.yml --- .github/workflows/oracle.yml | 35 +++++++++++++------------ .github/workflows/windows-python.yml | 38 +++++++++++++--------------- 2 files changed, 35 insertions(+), 38 deletions(-) diff --git a/.github/workflows/oracle.yml b/.github/workflows/oracle.yml index 9b0031e..6f32235 100644 --- a/.github/workflows/oracle.yml +++ b/.github/workflows/oracle.yml @@ -102,29 +102,26 @@ jobs: with: cmake-version: '3.26.x' - - name: Checkout or-tools - if: ${{ env.RELEASE_CREATED == 'false' }} + - name: Checkout this repository uses: actions/checkout@v4 - with: - repository: rte-france/or-tools - ref: ${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} - - name: Checkout or-tools + - name: set or-tools repo vars release if: ${{ env.RELEASE_CREATED == 'true' }} - uses: actions/checkout@v4 - with: - repository: google/or-tools - ref: 'v9.10' - - - name: Checkout this repository - uses: actions/checkout@v4 - with: - path: "patch" + shell: bash + run: | + OR_REPO="https://github.com/google/or-tools.git" + OR_REF="v9.10" + echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV + echo "OR_REF=$OR_REF" >> $GITHUB_ENV - - name: Apply patch + - name: set or-tools repo vars not release + if: ${{ env.RELEASE_CREATED == 'false' }} + shell: bash run: | - cp -r patch/ortools patch/patch.py patch/patch_utils.py . - python3 patch.py + OR_REPO="https://github.com/rte-france/or-tools.git" + OR_REF=${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} + echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV + echo "OR_REF=$OR_REF" >> $GITHUB_ENV - name: Set-up Xpress with pip run: | @@ -150,6 +147,8 @@ jobs: cmake --version cmake -S . -B build \ -DCMAKE_BUILD_TYPE=Release \ + -Dortools_REPO=${{ env.OR_REPO }} \ + -Dortools_REF=${{ env.OR_REF }} \ -DBUILD_SHARED_LIBS=${{ matrix.cmake.shared }} \ -DBUILD_PYTHON=${{ matrix.cmake.python }} \ -DBUILD_JAVA=${{ matrix.cmake.java }} \ diff --git a/.github/workflows/windows-python.yml b/.github/workflows/windows-python.yml index e7bae69..ca96481 100644 --- a/.github/workflows/windows-python.yml +++ b/.github/workflows/windows-python.yml @@ -39,24 +39,26 @@ jobs: { version: "3.11", dir: Python311 }, ] steps: - - name: Checkout or-tools - if: ${{ env.RELEASE_CREATED == 'false' }} + - name: Checkout this repository uses: actions/checkout@v4 - with: - repository: rte-france/or-tools - ref: ${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} - - name: Checkout or-tools + - name: set or-tools repo vars release if: ${{ env.RELEASE_CREATED == 'true' }} - uses: actions/checkout@v4 - with: - repository: google/or-tools - ref: 'stable' + shell: bash + run: | + OR_REPO="https://github.com/google/or-tools.git" + OR_REF="v9.10" + echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV + echo "OR_REF=$OR_REF" >> $GITHUB_ENV - - name: Checkout this repository - uses: actions/checkout@v4 - with: - path: "patch" + - name: set or-tools repo vars not release + if: ${{ env.RELEASE_CREATED == 'false' }} + shell: bash + run: | + OR_REPO="https://github.com/rte-france/or-tools.git" + OR_REF=${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} + echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV + echo "OR_REF=$OR_REF" >> $GITHUB_ENV - name: Set up Python uses: actions/setup-python@v5 @@ -66,12 +68,6 @@ jobs: - name: Install python3 run: python3 -m pip install --user mypy-protobuf absl-py setuptools wheel numpy pandas - - name: Apply patch - shell: bash - run: | - cp -r patch/ortools patch/patch.py patch/patch_utils.py . - python patch.py - - name: Install SWIG 4.1.1 run: | (New-Object System.Net.WebClient).DownloadFile("http://prdownloads.sourceforge.net/swig/swigwin-4.1.1.zip","swigwin-4.1.1.zip"); @@ -102,6 +98,8 @@ jobs: cmake -S. -Bbuild -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release + -Dortools_REPO="${{ env.OR_REPO }}" + -Dortools_REF="${{ env.OR_REF }}" -DBUILD_SAMPLES=OFF -DBUILD_EXAMPLES=${{ env.RELEASE_CREATED == 'true' && 'OFF' || 'ON' }} -DBUILD_CXX_SAMPLES=OFF -DBUILD_CXX_EXAMPLES=OFF From 285d17ccd515994d54adf3e67d5b6607c527bb30 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Thu, 22 Aug 2024 14:54:52 +0200 Subject: [PATCH 14/29] try fix oracle python3 --- CMakeLists.txt | 3 ++- patch.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f66ecb..10018c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ endif () if (NOT DEFINED ortools_REF) message(FATAL_ERROR "ortools_REF is not defined") endif () +find_package (Python REQUIRED) FetchContent_Declare(ortools GIT_REPOSITORY ${ortools_REPO} GIT_TAG ${ortools_REF} @@ -20,7 +21,7 @@ FetchContent_Declare(ortools ${CMAKE_CURRENT_SOURCE_DIR}/patch_utils.py ${CMAKE_CURRENT_SOURCE_DIR}/ortools ${CMAKE_CURRENT_SOURCE_DIR}/patchs - . && python patch.py + . && ${PYTHON_EXECUTABLE} patch.py OVERRIDE_FIND_PACKAGE ON ) message("BUILD_DEPS: " ${BUILD_DEPS}) diff --git a/patch.py b/patch.py index b37f7c5..7af5907 100644 --- a/patch.py +++ b/patch.py @@ -38,7 +38,7 @@ # add the USE_SIRIUS configuration flag in deps.cmake full_patch.append(Addition( - Path.cwd()/'cmake'/'deps.cmake', + Path.cwd()/'cmake'/'system_deps.cmake', ''' if(USE_CPLEX) find_package(CPLEX REQUIRED) From 70e672af778154fc99f5b9f24e83bd55672af466 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Thu, 22 Aug 2024 15:17:50 +0200 Subject: [PATCH 15/29] try fix oracle python3 --- CMakeLists.txt | 3 ++- docker/centos.dockerfile | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10018c0..b1bcae2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ if (NOT DEFINED ortools_REF) message(FATAL_ERROR "ortools_REF is not defined") endif () find_package (Python REQUIRED) +message("found PYTHON interpreter ${Python_EXECUTABLE} = " ${Python_EXECUTABLE}) FetchContent_Declare(ortools GIT_REPOSITORY ${ortools_REPO} GIT_TAG ${ortools_REF} @@ -21,7 +22,7 @@ FetchContent_Declare(ortools ${CMAKE_CURRENT_SOURCE_DIR}/patch_utils.py ${CMAKE_CURRENT_SOURCE_DIR}/ortools ${CMAKE_CURRENT_SOURCE_DIR}/patchs - . && ${PYTHON_EXECUTABLE} patch.py + . && ${Python_EXECUTABLE} patch.py OVERRIDE_FIND_PACKAGE ON ) message("BUILD_DEPS: " ${BUILD_DEPS}) diff --git a/docker/centos.dockerfile b/docker/centos.dockerfile index cda9f72..577c8ca 100644 --- a/docker/centos.dockerfile +++ b/docker/centos.dockerfile @@ -55,7 +55,7 @@ FROM base AS devel ARG SIRIUS=OFF ARG SHARED=ON ARG BUILD_EXAMPLES=OFF -ARG OR_REPO="https://github.com/rte-france/or-tools.git" +ARG OR_REPO="https://github.com/google/or-tools.git" ARG OR_REF="stable" WORKDIR /home/project COPY . . From 67c7054c178a358e215750c31094b301a412600a Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Thu, 22 Aug 2024 15:27:34 +0200 Subject: [PATCH 16/29] try fix patches --- CMakeLists.txt | 2 +- {patchs => cmake_patches}/sirius.cmake | 0 patch.py | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename {patchs => cmake_patches}/sirius.cmake (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index b1bcae2..ae9ae31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ FetchContent_Declare(ortools ${CMAKE_CURRENT_SOURCE_DIR}/patch.py ${CMAKE_CURRENT_SOURCE_DIR}/patch_utils.py ${CMAKE_CURRENT_SOURCE_DIR}/ortools - ${CMAKE_CURRENT_SOURCE_DIR}/patchs + ${CMAKE_CURRENT_SOURCE_DIR}/cmake_patches . && ${Python_EXECUTABLE} patch.py OVERRIDE_FIND_PACKAGE ON ) diff --git a/patchs/sirius.cmake b/cmake_patches/sirius.cmake similarity index 100% rename from patchs/sirius.cmake rename to cmake_patches/sirius.cmake diff --git a/patch.py b/patch.py index 7af5907..6b19078 100644 --- a/patch.py +++ b/patch.py @@ -47,7 +47,7 @@ ''' #add SIRIUS if (USE_SIRIUS) - include(patchs/sirius.cmake) + include(cmake_patches/sirius.cmake) if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) endif() From 3ee37032bd557a1b2ebfda6facea7060b45b554d Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Thu, 22 Aug 2024 15:32:17 +0200 Subject: [PATCH 17/29] try fix --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae9ae31..a72979e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ endif () if (NOT DEFINED ortools_REF) message(FATAL_ERROR "ortools_REF is not defined") endif () -find_package (Python REQUIRED) +find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module message("found PYTHON interpreter ${Python_EXECUTABLE} = " ${Python_EXECUTABLE}) FetchContent_Declare(ortools GIT_REPOSITORY ${ortools_REPO} @@ -22,7 +22,7 @@ FetchContent_Declare(ortools ${CMAKE_CURRENT_SOURCE_DIR}/patch_utils.py ${CMAKE_CURRENT_SOURCE_DIR}/ortools ${CMAKE_CURRENT_SOURCE_DIR}/cmake_patches - . && ${Python_EXECUTABLE} patch.py + . && ${Python3_EXECUTABLE} patch.py OVERRIDE_FIND_PACKAGE ON ) message("BUILD_DEPS: " ${BUILD_DEPS}) From cb5d51a312937de70cf8c63598d14d26b0fe428e Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Thu, 22 Aug 2024 15:38:10 +0200 Subject: [PATCH 18/29] fix typo --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a72979e..45101f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ endif () if (NOT DEFINED ortools_REF) message(FATAL_ERROR "ortools_REF is not defined") endif () -find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module +find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module) message("found PYTHON interpreter ${Python_EXECUTABLE} = " ${Python_EXECUTABLE}) FetchContent_Declare(ortools GIT_REPOSITORY ${ortools_REPO} From f7dd4891fc880a300199a4246e5dd12c6f041f88 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Thu, 22 Aug 2024 15:42:19 +0200 Subject: [PATCH 19/29] try fix centos.dockerfile --- docker/centos.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/centos.dockerfile b/docker/centos.dockerfile index 577c8ca..f68a56d 100644 --- a/docker/centos.dockerfile +++ b/docker/centos.dockerfile @@ -11,7 +11,7 @@ RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo &&\ 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 &&\ + yum install -y devtoolset-11 python3-devel python3-pip python3-numpy &&\ python3 -m pip install --upgrade pip &&\ python3 -m pip install dataclasses From bf0ad7c4e807925716205556a438e0b5a95be670 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Fri, 23 Aug 2024 10:17:19 +0200 Subject: [PATCH 20/29] switch back to deps.cmake --- patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patch.py b/patch.py index 6b19078..b486d7d 100644 --- a/patch.py +++ b/patch.py @@ -38,7 +38,7 @@ # add the USE_SIRIUS configuration flag in deps.cmake full_patch.append(Addition( - Path.cwd()/'cmake'/'system_deps.cmake', + Path.cwd()/'cmake'/'deps.cmake', ''' if(USE_CPLEX) find_package(CPLEX REQUIRED) From f5dd401be65c93dc32638e714be4a7ffdd76d866 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Fri, 23 Aug 2024 11:12:25 +0200 Subject: [PATCH 21/29] windows revert old style patch (no cmake) --- .github/workflows/windows-cpp.yml | 36 +++++++++++++------------- .github/workflows/windows-python.yml | 38 +++++++++++++++------------- 2 files changed, 39 insertions(+), 35 deletions(-) diff --git a/.github/workflows/windows-cpp.yml b/.github/workflows/windows-cpp.yml index 559d3b7..352b56c 100644 --- a/.github/workflows/windows-cpp.yml +++ b/.github/workflows/windows-cpp.yml @@ -37,31 +37,35 @@ jobs: os: [windows-latest] 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@v5 with: python-version: "3.8" - - name: set or-tools repo vars release - if: ${{ env.RELEASE_CREATED == 'true' }} - shell: bash - run: | - OR_REPO="https://github.com/google/or-tools.git" - OR_REF="v9.10" - echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV - echo "OR_REF=$OR_REF" >> $GITHUB_ENV - - - name: set or-tools repo vars not release - if: ${{ env.RELEASE_CREATED == 'false' }} + - name: Apply patch shell: bash run: | - OR_REPO="https://github.com/rte-france/or-tools.git" - OR_REF=${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} - echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV - echo "OR_REF=$OR_REF" >> $GITHUB_ENV + cp -r patch/ortools patch/patch.py patch/patch_utils.py . + python patch.py - name: Set-up Xpress with pip shell: bash @@ -92,8 +96,6 @@ jobs: cmake -S. -Bbuild -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release - -Dortools_REPO="${{ env.OR_REPO }}" - -Dortools_REF="${{ env.OR_REF }}" -DBUILD_DEPS=ON -DBUILD_EXAMPLES=${{ env.RELEASE_CREATED == 'true' && 'OFF' || 'ON' }} -DBUILD_SAMPLES=OFF diff --git a/.github/workflows/windows-python.yml b/.github/workflows/windows-python.yml index ca96481..80da8de 100644 --- a/.github/workflows/windows-python.yml +++ b/.github/workflows/windows-python.yml @@ -39,26 +39,24 @@ jobs: { version: "3.11", dir: Python311 }, ] steps: - - name: Checkout this repository + - 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: set or-tools repo vars release + - name: Checkout or-tools if: ${{ env.RELEASE_CREATED == 'true' }} - shell: bash - run: | - OR_REPO="https://github.com/google/or-tools.git" - OR_REF="v9.10" - echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV - echo "OR_REF=$OR_REF" >> $GITHUB_ENV + uses: actions/checkout@v4 + with: + repository: google/or-tools + ref: 'stable' - - name: set or-tools repo vars not release - if: ${{ env.RELEASE_CREATED == 'false' }} - shell: bash - run: | - OR_REPO="https://github.com/rte-france/or-tools.git" - OR_REF=${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} - echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV - echo "OR_REF=$OR_REF" >> $GITHUB_ENV + - name: Checkout this repository + uses: actions/checkout@v4 + with: + path: "patch" - name: Set up Python uses: actions/setup-python@v5 @@ -68,6 +66,12 @@ jobs: - name: Install python3 run: python3 -m pip install --user mypy-protobuf absl-py setuptools wheel numpy pandas + - name: Apply patch + shell: bash + run: | + cp -r patch/* . + python patch.py + - name: Install SWIG 4.1.1 run: | (New-Object System.Net.WebClient).DownloadFile("http://prdownloads.sourceforge.net/swig/swigwin-4.1.1.zip","swigwin-4.1.1.zip"); @@ -98,8 +102,6 @@ jobs: cmake -S. -Bbuild -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release - -Dortools_REPO="${{ env.OR_REPO }}" - -Dortools_REF="${{ env.OR_REF }}" -DBUILD_SAMPLES=OFF -DBUILD_EXAMPLES=${{ env.RELEASE_CREATED == 'true' && 'OFF' || 'ON' }} -DBUILD_CXX_SAMPLES=OFF -DBUILD_CXX_EXAMPLES=OFF From 431ddbc603304aadeeb6a728e0186505ca01aa28 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Fri, 23 Aug 2024 11:20:52 +0200 Subject: [PATCH 22/29] fix windows old style patch (no cmake) --- .github/workflows/windows-cpp.yml | 2 +- .github/workflows/windows-python.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-cpp.yml b/.github/workflows/windows-cpp.yml index 352b56c..52aef76 100644 --- a/.github/workflows/windows-cpp.yml +++ b/.github/workflows/windows-cpp.yml @@ -64,7 +64,7 @@ jobs: - name: Apply patch shell: bash run: | - cp -r patch/ortools patch/patch.py patch/patch_utils.py . + cp -r patch/ortools patch/patch.py patch/patch_utils.py patch/cmake_patches . python patch.py - name: Set-up Xpress with pip diff --git a/.github/workflows/windows-python.yml b/.github/workflows/windows-python.yml index 80da8de..afdbd06 100644 --- a/.github/workflows/windows-python.yml +++ b/.github/workflows/windows-python.yml @@ -69,7 +69,7 @@ jobs: - name: Apply patch shell: bash run: | - cp -r patch/* . + cp -r patch/ortools patch/patch.py patch/patch_utils.py patch/cmake_patches . python patch.py - name: Install SWIG 4.1.1 From eaf7cf5cb621632cae7713ea5d979950eee719ba Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Tue, 27 Aug 2024 10:08:07 +0200 Subject: [PATCH 23/29] fix windows python --- .github/workflows/windows-python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-python.yml b/.github/workflows/windows-python.yml index afdbd06..1db16bb 100644 --- a/.github/workflows/windows-python.yml +++ b/.github/workflows/windows-python.yml @@ -149,7 +149,7 @@ jobs: id: wheel shell: bash run: | - cd ./build/_deps/ortools-build/python/dist + cd ./build/python/dist MY_DIR="ortools_python-${{ matrix.python.version }}${{ steps.names.outputs.appendix }}" mkdir ${MY_DIR} cp *.whl "${MY_DIR}" From c7db70fe6a9a99a78bc744943ff0b126130171ce Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Thu, 12 Sep 2024 11:57:31 +0200 Subject: [PATCH 24/29] use repo tag to checkout google-ortools --- .github/workflows/centos.yml | 5 +++-- .github/workflows/oracle.yml | 5 +++-- .github/workflows/ubuntu.yml | 5 +++-- .github/workflows/windows-cpp.yml | 27 +++++++++++++++++++-------- .github/workflows/windows-python.yml | 27 +++++++++++++++++++-------- 5 files changed, 47 insertions(+), 22 deletions(-) diff --git a/.github/workflows/centos.yml b/.github/workflows/centos.yml index 838c93f..c342cf8 100644 --- a/.github/workflows/centos.yml +++ b/.github/workflows/centos.yml @@ -44,9 +44,10 @@ jobs: shell: bash run: | OR_REPO="https://github.com/google/or-tools.git" - OR_REF="v9.10" + TAGNAME="${{ github.event.release.tag_name }}" + TAGNAME_WITHOUT_SUFFIX=${TAGNAME%%-*} echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV - echo "OR_REF=$OR_REF" >> $GITHUB_ENV + echo "OR_REF=$TAGNAME_WITHOUT_SUFFIX" >> $GITHUB_ENV - name: set or-tools repo vars not release if: ${{ env.RELEASE_CREATED == 'false' }} diff --git a/.github/workflows/oracle.yml b/.github/workflows/oracle.yml index 6f32235..0517715 100644 --- a/.github/workflows/oracle.yml +++ b/.github/workflows/oracle.yml @@ -110,9 +110,10 @@ jobs: shell: bash run: | OR_REPO="https://github.com/google/or-tools.git" - OR_REF="v9.10" + TAGNAME="${{ github.event.release.tag_name }}" + TAGNAME_WITHOUT_SUFFIX=${TAGNAME%%-*} echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV - echo "OR_REF=$OR_REF" >> $GITHUB_ENV + echo "OR_REF=$TAGNAME_WITHOUT_SUFFIX" >> $GITHUB_ENV - name: set or-tools repo vars not release if: ${{ env.RELEASE_CREATED == 'false' }} diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 0f885a3..f21ab5f 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -59,9 +59,10 @@ jobs: shell: bash run: | OR_REPO="https://github.com/google/or-tools.git" - OR_REF="v9.10" + TAGNAME="${{ github.event.release.tag_name }}" + TAGNAME_WITHOUT_SUFFIX=${TAGNAME%%-*} echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV - echo "OR_REF=$OR_REF" >> $GITHUB_ENV + echo "OR_REF=$TAGNAME_WITHOUT_SUFFIX" >> $GITHUB_ENV - name: set or-tools repo vars not release if: ${{ env.RELEASE_CREATED == 'false' }} diff --git a/.github/workflows/windows-cpp.yml b/.github/workflows/windows-cpp.yml index 52aef76..b8ddf12 100644 --- a/.github/workflows/windows-cpp.yml +++ b/.github/workflows/windows-cpp.yml @@ -37,19 +37,30 @@ jobs: os: [windows-latest] sirius-release-tag: [ antares-integration-v1.4 ] steps: - - name: Checkout or-tools + - name: set or-tools repo vars release + if: ${{ env.RELEASE_CREATED == 'true' }} + shell: bash + run: | + OR_REPO="https://github.com/google/or-tools.git" + TAGNAME="${{ github.event.release.tag_name }}" + TAGNAME_WITHOUT_SUFFIX=${TAGNAME%%-*} + echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV + echo "OR_REF=$TAGNAME_WITHOUT_SUFFIX" >> $GITHUB_ENV + + - name: set or-tools repo vars not release if: ${{ env.RELEASE_CREATED == 'false' }} - uses: actions/checkout@v4 - with: - repository: rte-france/or-tools - ref: ${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} + shell: bash + run: | + OR_REPO="https://github.com/rte-france/or-tools.git" + OR_REF=${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} + echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV + echo "OR_REF=$OR_REF" >> $GITHUB_ENV - name: Checkout or-tools - if: ${{ env.RELEASE_CREATED == 'true' }} uses: actions/checkout@v4 with: - repository: google/or-tools - ref: 'stable' + repository: ${{ env.OR_REPO }} + ref: ${{ env.OR_REF }} - name: Checkout this repository uses: actions/checkout@v4 diff --git a/.github/workflows/windows-python.yml b/.github/workflows/windows-python.yml index 1db16bb..0888a16 100644 --- a/.github/workflows/windows-python.yml +++ b/.github/workflows/windows-python.yml @@ -39,19 +39,30 @@ jobs: { version: "3.11", dir: Python311 }, ] steps: - - name: Checkout or-tools + - name: set or-tools repo vars release + if: ${{ env.RELEASE_CREATED == 'true' }} + shell: bash + run: | + OR_REPO="https://github.com/google/or-tools.git" + TAGNAME="${{ github.event.release.tag_name }}" + TAGNAME_WITHOUT_SUFFIX=${TAGNAME%%-*} + echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV + echo "OR_REF=$TAGNAME_WITHOUT_SUFFIX" >> $GITHUB_ENV + + - name: set or-tools repo vars not release if: ${{ env.RELEASE_CREATED == 'false' }} - uses: actions/checkout@v4 - with: - repository: rte-france/or-tools - ref: ${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} + shell: bash + run: | + OR_REPO="https://github.com/rte-france/or-tools.git" + OR_REF=${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} + echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV + echo "OR_REF=$OR_REF" >> $GITHUB_ENV - name: Checkout or-tools - if: ${{ env.RELEASE_CREATED == 'true' }} uses: actions/checkout@v4 with: - repository: google/or-tools - ref: 'stable' + repository: ${{ env.OR_REPO }} + ref: ${{ env.OR_REF }} - name: Checkout this repository uses: actions/checkout@v4 From 505ca9282901cfb04ae918f79640b9f9cfe3b0e0 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Thu, 12 Sep 2024 12:15:31 +0200 Subject: [PATCH 25/29] fix windows --- .github/workflows/windows-cpp.yml | 19 +++++++++---------- .github/workflows/windows-python.yml | 19 +++++++++---------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/windows-cpp.yml b/.github/workflows/windows-cpp.yml index b8ddf12..52041ef 100644 --- a/.github/workflows/windows-cpp.yml +++ b/.github/workflows/windows-cpp.yml @@ -37,7 +37,7 @@ jobs: os: [windows-latest] sirius-release-tag: [ antares-integration-v1.4 ] steps: - - name: set or-tools repo vars release + - name: set or-tools repo vars if release if: ${{ env.RELEASE_CREATED == 'true' }} shell: bash run: | @@ -47,19 +47,18 @@ jobs: echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV echo "OR_REF=$TAGNAME_WITHOUT_SUFFIX" >> $GITHUB_ENV - - name: set or-tools repo vars not release + - name: Checkout or-tools not release if: ${{ env.RELEASE_CREATED == 'false' }} - shell: bash - run: | - OR_REPO="https://github.com/rte-france/or-tools.git" - OR_REF=${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} - echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV - echo "OR_REF=$OR_REF" >> $GITHUB_ENV + uses: actions/checkout@v4 + with: + repository: rte-france/or-tools + ref: ${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} - - name: Checkout or-tools + - name: Checkout or-tools if release + if: ${{ env.RELEASE_CREATED == 'true' }} uses: actions/checkout@v4 with: - repository: ${{ env.OR_REPO }} + repository: google/or-tools ref: ${{ env.OR_REF }} - name: Checkout this repository diff --git a/.github/workflows/windows-python.yml b/.github/workflows/windows-python.yml index 0888a16..8a19f3c 100644 --- a/.github/workflows/windows-python.yml +++ b/.github/workflows/windows-python.yml @@ -39,7 +39,7 @@ jobs: { version: "3.11", dir: Python311 }, ] steps: - - name: set or-tools repo vars release + - name: set or-tools repo vars if release if: ${{ env.RELEASE_CREATED == 'true' }} shell: bash run: | @@ -49,19 +49,18 @@ jobs: echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV echo "OR_REF=$TAGNAME_WITHOUT_SUFFIX" >> $GITHUB_ENV - - name: set or-tools repo vars not release + - name: Checkout or-tools not release if: ${{ env.RELEASE_CREATED == 'false' }} - shell: bash - run: | - OR_REPO="https://github.com/rte-france/or-tools.git" - OR_REF=${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} - echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV - echo "OR_REF=$OR_REF" >> $GITHUB_ENV + uses: actions/checkout@v4 + with: + repository: rte-france/or-tools + ref: ${{ github.event.inputs.rtefrance_ortools_branch || 'main' }} - - name: Checkout or-tools + - name: Checkout or-tools if release + if: ${{ env.RELEASE_CREATED == 'true' }} uses: actions/checkout@v4 with: - repository: ${{ env.OR_REPO }} + repository: google/or-tools ref: ${{ env.OR_REF }} - name: Checkout this repository From 998f8e9686851cc19cd39288255d663919e8f57c Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Thu, 12 Sep 2024 12:23:45 +0200 Subject: [PATCH 26/29] fix patch.py for main --- patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patch.py b/patch.py index b486d7d..6b19078 100644 --- a/patch.py +++ b/patch.py @@ -38,7 +38,7 @@ # add the USE_SIRIUS configuration flag in deps.cmake full_patch.append(Addition( - Path.cwd()/'cmake'/'deps.cmake', + Path.cwd()/'cmake'/'system_deps.cmake', ''' if(USE_CPLEX) find_package(CPLEX REQUIRED) From c0aa22c6e4c582c940c458b00e5f83e207f4bf54 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Thu, 12 Sep 2024 17:52:36 +0200 Subject: [PATCH 27/29] remove line about shared libs --- CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45101f9..026a6a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,11 +32,6 @@ set_if_not_defined(BUILD_FLATZINC "OFF" CACHE INTERNAL "") set_if_not_defined(BUILD_EXAMPLES "OFF" CACHE INTERNAL "") set_if_not_defined(USE_SCIP "ON" CACHE INTERNAL "") set_if_not_defined(USE_GLPK "ON" CACHE INTERNAL "") -# We build OR-Tools as a static lib. Cyclic dependencies are detected -# without this flag. -set_if_not_defined(BUILD_SHARED_LIBS "OFF" CACHE INTERNAL "") -# In mode optimization error analysis, we call Sirius through or-tools -# So we need to activate Sirius in or-tools configuration (OFF by default) set_if_not_defined(USE_SIRIUS "OFF" CACHE INTERNAL "") FetchContent_MakeAvailable(ortools) find_package(ortools REQUIRED) From b8dbfaa427885956332048170cf64073a9b5b7d7 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Thu, 12 Sep 2024 17:54:12 +0200 Subject: [PATCH 28/29] change order of 2 steps in Windows CI --- .github/workflows/windows-cpp.yml | 14 +++++++------- .github/workflows/windows-python.yml | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/windows-cpp.yml b/.github/workflows/windows-cpp.yml index 52041ef..9326a5b 100644 --- a/.github/workflows/windows-cpp.yml +++ b/.github/workflows/windows-cpp.yml @@ -47,13 +47,6 @@ jobs: echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV echo "OR_REF=$TAGNAME_WITHOUT_SUFFIX" >> $GITHUB_ENV - - name: Checkout or-tools not release - 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 release if: ${{ env.RELEASE_CREATED == 'true' }} uses: actions/checkout@v4 @@ -61,6 +54,13 @@ jobs: repository: google/or-tools ref: ${{ env.OR_REF }} + - name: Checkout or-tools not release + 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 this repository uses: actions/checkout@v4 with: diff --git a/.github/workflows/windows-python.yml b/.github/workflows/windows-python.yml index 8a19f3c..dfe4a48 100644 --- a/.github/workflows/windows-python.yml +++ b/.github/workflows/windows-python.yml @@ -49,13 +49,6 @@ jobs: echo "OR_REPO=$OR_REPO" >> $GITHUB_ENV echo "OR_REF=$TAGNAME_WITHOUT_SUFFIX" >> $GITHUB_ENV - - name: Checkout or-tools not release - 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 release if: ${{ env.RELEASE_CREATED == 'true' }} uses: actions/checkout@v4 @@ -63,6 +56,13 @@ jobs: repository: google/or-tools ref: ${{ env.OR_REF }} + - name: Checkout or-tools not release + 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 this repository uses: actions/checkout@v4 with: From b0b30cc19c250870b3f75d4c5f35aa967ff96e7b Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Fri, 13 Sep 2024 14:11:07 +0200 Subject: [PATCH 29/29] fix hithubactions warnings --- .github/workflows/oracle.yml | 3 --- .github/workflows/ubuntu.yml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/oracle.yml b/.github/workflows/oracle.yml index 0517715..a4f0c0a 100644 --- a/.github/workflows/oracle.yml +++ b/.github/workflows/oracle.yml @@ -52,9 +52,6 @@ jobs: APPENDIX_WITH_SHARED="${OS}${WITH_SHARED}${WITH_SIRIUS}" echo "appendix_with_shared=$APPENDIX_WITH_SHARED" >> $GITHUB_OUTPUT - # Fill variable ${BRANCH_NAME} - - uses: nelonoel/branch-name@v1.0.1 - - name: Install requirements (dnf) run: | dnf -y update diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index f21ab5f..58e602b 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -97,7 +97,7 @@ jobs: - name: Setup .NET 6.0 if: ${{ matrix.cmake.dotnet == 'ON' }} - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: 6.0.x