indent windows vcpkg #12832
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 (VCPKG and pre-compiled) | |
on: | |
push: | |
branches: | |
- develop | |
- feature/* | |
- features/* | |
- fix/* | |
- issue-* | |
- release/* | |
- doc/* | |
- dependabot/* | |
schedule: | |
- cron: '21 2 * * *' | |
workflow_call: | |
inputs: | |
run-tests: | |
required: true | |
type: string | |
target_branch: | |
required: true | |
type: string | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' }} | |
RUN_EXTENDED_TESTS: ${{ inputs.target_branch == 'release/8.8.x' }} | |
REF: ${{ inputs.target_branch =='' && github.ref || inputs.target_branch}} | |
jobs: | |
build: | |
env: | |
# Indicates the location of the vcpkg as a Git submodule of the project repository. | |
VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
ORTOOLS_DIR: ${{ github.workspace }}/or-tools | |
os: windows-latest | |
test-platform: windows-2022 | |
vcpkgPackages: wxwidgets boost-test yaml-cpp antlr4 | |
triplet: x64-windows | |
# Caching strategy of VCPKG dependencies | |
VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg_cache,readwrite" | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.REF }} | |
- name: Config OR-Tools URL | |
run: | | |
echo "ORTOOLS_URL=https://github.com/rte-france/or-tools-rte/releases/download/$(cat ortools_tag)/ortools_cxx_windows-latest_static_sirius.zip" >> $GITHUB_ENV | |
shell: bash | |
- name: Pre-requisites | |
shell: cmd | |
run: | | |
choco install wget unzip zip --no-progress | |
# Downloads ccache, and copies it to "cl.exe" in order to trick cmake into using it, | |
# see ccache wiki for background on using it with MSVC: | |
# https://github.com/ccache/ccache/wiki/MS-Visual-Studio | |
- name: Install ccache | |
shell: bash | |
run: | | |
wget https://github.com/ccache/ccache/releases/download/v4.8.3/ccache-4.8.3-windows-x86_64.zip -O ccache.zip | |
unzip ccache.zip | |
rm ccache.zip | |
mv ccache-4.8.3-windows-x86_64 ccache | |
cp ccache/ccache.exe ccache/cl.exe | |
echo "${GITHUB_WORKSPACE}/ccache" >> $GITHUB_PATH | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: windows | |
- name : Init VCPKG submodule | |
shell: bash | |
run: | | |
git submodule update --init vcpkg && ./vcpkg/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: Download pre-compiled librairies | |
uses: ./.github/workflows/download-extract-precompiled-libraries-zip | |
with: | |
os: ${{env.os}} | |
ortools-url: ${{env.ORTOOLS_URL}} | |
ortools-dir: ${{env.ORTOOLS_DIR}} | |
- name: Setup Python 3.12 | |
uses: actions/setup-python@v5 | |
id: setup-python | |
with: | |
architecture: 'x64' | |
python-version: '3.12' | |
- name: Install pip dependencies if necessary | |
run: pip install -r src/tests/examples/requirements.txt | |
- name: Enable git longpaths | |
run: git config --system core.longpaths true | |
- name: Configure | |
shell: bash | |
run: | | |
cmake -B _build -S src \ | |
-DCMAKE_PREFIX_PATH="${{ env.ORTOOLS_DIR }}/install" \ | |
-DVCPKG_ROOT="${{env.VCPKG_ROOT}}" \ | |
-DVCPKG_TARGET_TRIPLET=${{ env.triplet }} \ | |
-DCMAKE_TOOLCHAIN_FILE="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DBUILD_TESTING=ON \ | |
-DBUILD_TOOLS=ON \ | |
-DBUILD_not_system=OFF \ | |
-DPython3_EXECUTABLE="${{ env.Python3_ROOT_DIR }}/python.exe" \ | |
-DCMAKE_VS_GLOBALS="CLToolExe=cl.exe;CLToolPath=${GITHUB_WORKSPACE}/ccache;TrackFileAccess=false;UseMultiToolTask=true;DebugInformationFormat=OldStyle" | |
- name: Build | |
shell: bash | |
run: | | |
cmake --build _build --config Release -j$(nproc) | |
# simtest | |
- name: Read simtest version | |
id: simtest-version | |
uses: notiz-dev/github-action-json-property@release | |
with: | |
path: 'simtest.json' | |
prop_path: 'version' | |
- name: Run named mps tests | |
uses: ./.github/workflows/run-tests | |
with: | |
simtest-tag: ${{steps.simtest-version.outputs.prop}} | |
batch-name: valid-named-mps | |
os: ${{ env.test-platform }} | |
variant: "named-mps" | |
- name: Run unfeasibility-related tests | |
run: | | |
cd _build | |
ctest -C Release --output-on-failure -R "^unfeasible$" | |
- name: Run unit and end-to-end tests | |
run: | | |
cd _build | |
ctest -C Release --output-on-failure -L "unit|end-to-end" -LE ortools | |
- name: Upload build on failure | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: MPS-diff | |
path: ${{ github.workspace }}/src/tests/mps | |
- name: Run tests about infinity on BCs RHS | |
uses: ./.github/workflows/run-tests | |
with: | |
simtest-tag: ${{steps.simtest-version.outputs.prop}} | |
batch-name: valid-v830 | |
os: ${{ env.test-platform }} | |
- name: Run MILP with CBC | |
uses: ./.github/workflows/run-tests | |
with: | |
simtest-tag: ${{steps.simtest-version.outputs.prop}} | |
batch-name: valid-milp | |
variant: "milp-cbc" | |
os: ${{ env.test-platform }} | |
- name: Run tests introduced in v860 | |
uses: ./.github/workflows/run-tests | |
with: | |
simtest-tag: ${{steps.simtest-version.outputs.prop}} | |
batch-name: valid-v860 | |
os: ${{ env.test-platform }} | |
- name: Run tests introduced in v870 | |
uses: ./.github/workflows/run-tests | |
with: | |
simtest-tag: ${{steps.simtest-version.outputs.prop}} | |
batch-name: valid-v870 | |
os: ${{ env.test-platform }} | |
- name: Run short-tests | |
uses: ./.github/workflows/run-tests | |
with: | |
simtest-tag: ${{steps.simtest-version.outputs.prop}} | |
batch-name: short-tests | |
os: ${{ env.test-platform }} | |
- name: Run mps tests | |
uses: ./.github/workflows/run-tests | |
with: | |
simtest-tag: ${{steps.simtest-version.outputs.prop}} | |
batch-name: valid-mps | |
os: ${{ env.test-platform }} | |
- name: Run tests on adequacy patch | |
uses: ./.github/workflows/run-tests | |
with: | |
simtest-tag: ${{steps.simtest-version.outputs.prop}} | |
batch-name: adequacy-patch-CSR | |
os: ${{ env.test-platform }} | |
- name: Run parallel tests | |
if: ${{ env.RUN_EXTENDED_TESTS == 'true' }} | |
uses: ./.github/workflows/run-tests | |
with: | |
simtest-tag: ${{steps.simtest-version.outputs.prop}} | |
batch-name: valid-parallel | |
os: ${{ env.test-platform }} | |
variant: "parallel" | |
- name: Run medium-tests | |
if: ${{ env.RUN_EXTENDED_TESTS == 'true' }} | |
uses: ./.github/workflows/run-tests | |
with: | |
simtest-tag: ${{steps.simtest-version.outputs.prop}} | |
batch-name: medium-tests | |
os: ${{ env.test-platform }} | |
- name: Run long-tests-1 | |
if: ${{ env.RUN_EXTENDED_TESTS == 'true' }} | |
uses: ./.github/workflows/run-tests | |
with: | |
simtest-tag: ${{steps.simtest-version.outputs.prop}} | |
batch-name: long-tests-1 | |
os: ${{ env.test-platform }} | |
- name: Run long-tests-2 | |
if: ${{ env.RUN_EXTENDED_TESTS == 'true' }} | |
uses: ./.github/workflows/run-tests | |
with: | |
simtest-tag: ${{steps.simtest-version.outputs.prop}} | |
batch-name: long-tests-2 | |
os: ${{ env.test-platform }} | |
- name: Run long-tests-3 | |
if: ${{ env.RUN_EXTENDED_TESTS == 'true' }} | |
uses: ./.github/workflows/run-tests | |
with: | |
simtest-tag: ${{steps.simtest-version.outputs.prop}} | |
batch-name: long-tests-3 | |
os: ${{ env.test-platform }} | |
- name: Solver archive creation | |
shell: bash | |
run: | | |
cd _build | |
zip -r antares-solver_windows.zip solver/Release/antares-*-solver.exe solver/Release/*.dll | |
- name: NSIS Installer creation | |
shell: bash | |
run: | | |
rm -rf src/tests/resources/Antares_Simulator_Tests | |
cd _build | |
cpack -GNSIS | |
export NSIS_NAME=$(ls *.exe) | |
echo "NSIS_NAME=$NSIS_NAME" >> $GITHUB_ENV | |
- name: Upload NSIS log on failure | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: NSISError.log | |
path: _build/_CPack_Packages/win64/NSIS/NSISOutput.log | |
- name: .zip creation | |
run: | | |
cd _build | |
cpack -G ZIP | |
- name: Installer upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: installer | |
path: _build/${{env.NSIS_NAME}} | |
- name: Publish assets | |
if: ${{ env.IS_RELEASE == 'true' }} | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
tag: ${{ github.event.inputs.release_tag }} | |
run: | | |
gh release upload "$tag" _build/*.zip _build/*.exe | |
shell: bash | |
- 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') }} |