From f5dd401be65c93dc32638e714be4a7ffdd76d866 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Fri, 23 Aug 2024 11:12:25 +0200 Subject: [PATCH] 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