Windows CI full build #18
This file contains hidden or 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
| name: Windows CI full build | |
| on: | |
| push: | |
| branches: | |
| - ci/* | |
| - dependabot/** | |
| schedule: | |
| - cron: '00 00 * * 0' # Sunday, midnight | |
| jobs: | |
| windows: | |
| runs-on: ${{ matrix.os }} | |
| if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
| strategy: | |
| matrix: | |
| os: [ windows-latest ] | |
| triplet: [ x64-windows ] | |
| env: | |
| # Indicates the location of the vcpkg as a Git submodule of the project repository. | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg_cache,readwrite" | |
| PYTHON_VERSION: "3.10" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Enable git longpaths | |
| run: git config --system core.longpaths true | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements-tests.txt | |
| - name: Set-up Xpress with pip | |
| shell: bash | |
| run: | | |
| python -m pip install --no-cache-dir "xpress==9.2.12" | |
| SITE_PACKAGE="${{ env.pythonLocation }}\Lib\site-packages" | |
| XPRESS_DIR="$SITE_PACKAGE\xpresslibs" | |
| cp -r $XPRESS_DIR/lib $XPRESS_DIR/bin | |
| mkdir -p $SITE_PACKAGE/xpress/bin | |
| cp $SITE_PACKAGE/xpress/license/community-xpauth.xpr $XPRESS_DIR/bin/xpauth.xpr | |
| echo "XPRESSDIR=$XPRESS_DIR" >> $GITHUB_ENV | |
| echo "$XPRESS_DIR/bin" >> $GITHUB_PATH | |
| - name: Pre-requisites | |
| shell: cmd | |
| run: | | |
| curl -OLs https://github.com/microsoft/Microsoft-MPI/releases/download/v10.1.1/msmpisetup.exe | |
| msmpisetup.exe -unattend | |
| - name: Read antares-xpansion version | |
| id: antares-xpansion-version | |
| uses: ./.github/actions/read-json-value | |
| with: | |
| path: 'antares-version.json' | |
| key: 'antares_xpansion_version' | |
| - name: vcpkg install | |
| shell: bash | |
| run: | | |
| git submodule update --remote --init vcpkg | |
| pushd vcpkg | |
| git fetch --unshallow | |
| ./bootstrap-vcpkg.bat -disableMetrics | |
| - name: Restore vcpkg binary dir from cache | |
| id: cache-vcpkg-binary | |
| uses: actions/cache/restore@v5 | |
| with: | |
| path: ${{ github.workspace }}/vcpkg_cache | |
| key: vcpkg-cache-windows-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }} | |
| # Allows to restore a cache when deps have only partially changed (like adding a dependency) | |
| restore-keys: vcpkg-cache-windows | |
| - name: Configure | |
| run: | | |
| $pwd=Get-Location | |
| cmake -B _build -S . -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_INSTALL_PREFIX=_install | |
| - name: Cache vcpkg binary dir | |
| if: always() | |
| id: save-cache-vcpkg-binary | |
| uses: actions/cache/save@v5 | |
| with: | |
| path: ${{ github.workspace }}/vcpkg_cache | |
| key: vcpkg-cache-windows-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }} | |
| - name: Build | |
| run: | | |
| cmake --build _build --config Release -j4 | |
| cd _build | |
| cmake --install . | |
| - name: Running unit tests | |
| shell: cmd | |
| run: | | |
| set PATH=%PATH%;C:\Program Files\Microsoft MPI\Bin\ | |
| cd _build | |
| ctest -C Release --output-on-failure -L "medium|unit|benders|lpnamer" | |
| - name: Installer .zip creation | |
| run: | | |
| cd _build | |
| cpack -G ZIP | |
| - id: create-single-file | |
| name: Single file .zip creation | |
| uses: ./.github/workflows/single-file-creation-zip | |
| with: | |
| antares-xpansion-version: ${{steps.antares-xpansion-version.outputs.result}} |