Windows CI full build #918
This file contains 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" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Enable git longpaths | |
run: git config --system core.longpaths true | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-tests.txt | |
- name: Pre-requisites | |
shell: cmd | |
run: | | |
choco install wget zip unzip --no-progress | |
wget -nv 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@v4 | |
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@v4 | |
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}} |