Windows CI (Release) #129
Workflow file for this run
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 (Release) | |
on: | |
release: | |
types: [created] | |
jobs: | |
windows: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest] | |
include: | |
- os: windows-latest | |
triplet: x64-windows | |
vcpkgPackages: wxwidgets boost-test | |
test-platform: windows-2022 | |
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 | |
ORTOOLS_URL: "https://github.com/rte-france/or-tools/releases/download/v9.5-rte2.0/ortools_cxx_windows-latest_static_sirius.zip" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Pre-requisites | |
shell: cmd | |
run: | | |
choco install wget unzip zip --no-progress | |
# Restore both vcpkg and its artifacts from the GitHub cache service. | |
- name: Restore vcpkg and its artifacts. | |
uses: actions/cache@v3 | |
with: | |
# The first path is the location of vcpkg (it contains the vcpkg executable and data files). | |
# The other paths starting with '!' are exclusions: they contain termporary files generated during the build of the installed packages. | |
path: | | |
${{ env.VCPKG_ROOT }} | |
!${{ env.VCPKG_ROOT }}/buildtrees | |
!${{ env.VCPKG_ROOT }}/packages | |
!${{ env.VCPKG_ROOT }}/downloads | |
# The key is composed in a way that it gets properly invalidated: this must happen whenever vcpkg's Git commit id changes, or the list of packages changes. In this case a cache miss must happen and a new entry with a new key with be pushed to GitHub the cache service. | |
# The key includes: hash of the vcpkg.json file, the hash of the vcpkg Git commit id, and the used vcpkg's triplet. The vcpkg's commit id would suffice, but computing an hash out it does not harm. | |
# Note: given a key, the cache content is immutable. If a cache entry has been created improperly, in order the recreate the right content the key must be changed as well, and it must be brand new (i.e. not existing already). | |
key: | | |
${{ hashFiles( 'vcpkg_manifest/vcpkg.json' ) }}-${{ hashFiles( '.git/modules/vcpkg/HEAD' )}}-${{ matrix.triplet }} | |
- name: Setup Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
architecture: 'x64' | |
python-version: '3.11' | |
- name : Install deps with VCPKG | |
run: | | |
git submodule update --init vcpkg | |
cd vcpkg | |
./bootstrap-vcpkg.sh | |
vcpkg install ${{matrix.vcpkgPackages}} --triplet ${{matrix.triplet}} | |
rm -rf buildtrees packages downloads | |
shell: bash | |
- name: Read antares-deps version | |
id: antares-deps-version | |
uses: notiz-dev/github-action-json-property@release | |
with: | |
path: 'antares-deps-version.json' | |
prop_path: 'antares_deps_version' | |
- name: Download pre-compiled librairies | |
uses: ./.github/workflows/download-extract-precompiled-libraries-zip | |
with: | |
antares-deps-version: ${{steps.antares-deps-version.outputs.prop}} | |
os: ${{matrix.os}} | |
ortools-url: ${{env.ORTOOLS_URL}} | |
ortools-dir: ${{env.ORTOOLS_DIR}} | |
- name: Install pip dependencies if necessary | |
run: pip install -r src/tests/examples/requirements.txt | |
# TODO : don't download submodule Antares_Simulator_Tests | |
- name: Init submodule | |
run: | | |
git submodule update --init --recursive src | |
- name: Enable git longpaths | |
run: git config --system core.longpaths true | |
- name: Configure with VCPKG | |
shell: bash | |
run: | | |
cmake -B _build -S src \ | |
-DDEPS_INSTALL_DIR=rte-antares-deps-Release \ | |
-DCMAKE_PREFIX_PATH="${{env.ORTOOLS_DIR}}/install" \ | |
-DVCPKG_ROOT="${{env.VCPKG_ROOT}}" \ | |
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} \ | |
-DCMAKE_BUILD_TYPE=release \ | |
-DBUILD_TESTING=ON \ | |
-DBUILD_not_system=OFF | |
- name: Build | |
run: | | |
cmake --build _build --config release -j2 | |
- name: Remove OR-Tools install directory to free some disk space | |
shell: bash | |
run: rm -rf ${{env.ORTOOLS_DIR}} | |
- name: Remove antares-deps to free some disk space | |
shell: bash | |
run: rm -rf ${{ github.workspace }}/src/antares-deps | |
# TODO : don't download submodule Antares_Simulator_Tests | |
- name: Remove Antares_Simulator_Tests to free some disk space | |
shell: bash | |
run: rm -rf ${{ github.workspace }}/src/tests/resources/Antares_Simulator_Tests | |
- name: Remove _deps to free some disk space | |
shell: bash | |
run: rm -rf ${{ github.workspace }}/src/_build/_deps | |
# 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 tests for adequacy patch (CSR) | |
uses: ./.github/workflows/run-tests | |
with: | |
simtest-tag: ${{steps.simtest-version.outputs.prop}} | |
batch-name: adequacy-patch-CSR | |
os: ${{ matrix.test-platform }} | |
- name: Run medium-tests | |
uses: ./.github/workflows/run-tests | |
with: | |
simtest-tag: ${{steps.simtest-version.outputs.prop}} | |
batch-name: medium-tests | |
os: ${{ matrix.test-platform }} | |
- name: Run long-tests-1 | |
uses: ./.github/workflows/run-tests | |
with: | |
simtest-tag: ${{steps.simtest-version.outputs.prop}} | |
batch-name: long-tests-1 | |
os: ${{ matrix.test-platform }} | |
- name: Run long-tests-2 | |
uses: ./.github/workflows/run-tests | |
with: | |
simtest-tag: ${{steps.simtest-version.outputs.prop}} | |
batch-name: long-tests-2 | |
os: ${{ matrix.test-platform }} | |
- name: Run long-tests-3 | |
uses: ./.github/workflows/run-tests | |
with: | |
simtest-tag: ${{steps.simtest-version.outputs.prop}} | |
batch-name: long-tests-3 | |
os: ${{ matrix.test-platform }} | |
- name: .zip creation | |
shell: bash | |
run: | | |
cd _build | |
cpack -G ZIP | |
export ZIP_NAME=$(ls *.zip) | |
echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_ENV | |
- 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 | |
rm -rf src/tests/resources/NonRegTests | |
cd _build | |
cpack -GNSIS | |
export NSIS_NAME=$(ls *.exe) | |
echo "NSIS_NAME=$NSIS_NAME" >> $GITHUB_ENV | |
- name: Upload NSIS logs | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: NSISOutput.log | |
path: _build/_CPack_Packages/win64/NSIS/NSISOutput.log | |
- name: Upload release assets | |
uses: softprops/[email protected] | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
_build/${{env.NSIS_NAME}} | |
_build/${{env.ZIP_NAME}} | |
_build/solver.zip |