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: "CMake, VS 2022, & Windows. Build installer and test it" | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "main", "Cross_platform" ] | |
pull_request: | |
branches: [ "main", "Cross_platform" ] | |
env: | |
CONFIGURATION: Release | |
PLATFORM: x64 | |
BOOST_VERSION: '1.8.3' | |
jobs: | |
build_and_upload_installer: | |
name: "CMake, VS 2022, & Windows. Build installer" | |
runs-on: windows-2022 | |
outputs: | |
installer_file_name: ${{ steps.output_installer_file_name.outputs.name }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 'Add "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\bin" to path' | |
shell: bash | |
run: echo "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\bin" >> $GITHUB_PATH | |
- name: Deploy Advinst | |
uses: caphyon/[email protected] | |
with: | |
# advinst-version: '21.3' | |
advinst-version: '21.7.1' | |
# - name: Make vcpkg dir on this drive | |
# run: mkdir c:\my_vcpkg | |
# - name: Install vcpkg on the same drive as the working dir | |
# shell: cmd | |
# run: | | |
# git clone --depth=1 https://github.com/microsoft/vcpkg/ | |
# .\vcpkg\bootstrap-vcpkg.bat | |
- name: Create_sDNA_Installer_with_CMake | |
shell: cmd | |
# CMake errors if given c:\vcpkg and /scripts/buildsystems/vcpkg.cmake | |
# so can't use set VCPKG_ROOT=%VCPKG_INSTALLATION_ROOT% | |
run: | | |
.\create_installer_with_Visual_Studio_17_2022.bat | |
# - name: Create_sDNA_Installer_with_CMake | |
# shell: bash | |
# run: | | |
# cmake -G "Visual Studio 17 2022" -A Win32 -B build_output_cmake_Win32 -S . -D USE_ZIG=OFF | |
# cmake --build build_output_cmake_Win32 --config Release | |
# cmake -G "Visual Studio 17 2022" -A x64 -B build_output_cmake_x64 -S . -D USE_ZIG=OFF | |
# cmake --build build_output_cmake_x64 --config Release | |
# - name: Make installer | |
# run: AdvancedInstaller.com /build installerbits\advanced\sdna.aip && ^ | |
# - name: Rename installer | |
# run: python -u installerbits\rename_version.py installerbits/advanced/output/sdna_setup.msi . | |
- name: Output the name of the .msi installer file | |
id: output_installer_file_name | |
shell: bash | |
run: echo "name=$(ls sDNA_setup_win_v*.msi)" >> "$GITHUB_OUTPUT" | |
- name: upload_installer_msi | |
id: installer-upload-step | |
uses: actions/upload-artifact@v4 | |
with: | |
name: installer_file | |
# this file name pattern is defined in installerbits\rename_version.py | |
# outfilename = os.path.join(outputdir, "sDNA_setup_win_v%s.msi" % filename_friendly_version) | |
path: sDNA_setup_win_v*.msi | |
test_installer: | |
needs: build_and_upload_installer | |
strategy: | |
fail-fast: false | |
matrix: | |
python_version: ['2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] | |
name: "Download and run sDNA installer, and run diff tests on it. " | |
runs-on: windows-2022 | |
# Note: The Windows server 2022 Github runner image already includes | |
# Python (currently 6 versions from 3.7 to 3.12) and a couple of | |
# VC++ redistributables. Desktop users may need to install these | |
# themselves, in addition to sDNA. | |
# | |
# https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md | |
# | |
env: | |
installer_file_name: ${{ needs.build_and_upload_installer.outputs.installer_file_name }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download installer built in previous job | |
uses: actions/download-artifact@v4 | |
with: | |
name: installer_file | |
- shell: cmd | |
run: dir . | |
- name: Allow the .msi to be executed | |
run: Set-ItemProperty -Path ${{ env.installer_file_name }} -Name IsReadOnly -Value $false | |
- name: Run sDNA installer using powershell script. | |
# This is based on @Simran-B's powershell script (from Github Community forum), | |
# according to GuiFalourd on Stack Overflow | |
# https://stackoverflow.com/a/72291019/20785734 | |
run: | | |
$file = "${{ env.installer_file_name }}" | |
$log = "install.log" | |
$procMain = Start-Process "msiexec" "/i `"$file`" /qn /l*! `"$log`"" -NoNewWindow -PassThru | |
$procLog = Start-Process "powershell" "Get-Content -Path `"$log`" -Wait" -NoNewWindow -PassThru | |
$procMain.WaitForExit() | |
$procLog.Kill() | |
Remove-Item $file | |
- name: Run regression tests | |
uses: ./.github/actions/run_regression_tests | |
with: | |
python_version: ${{ matrix.python_version }} | |
DONT_TEST_N_LINK_SUBSYSTEMS_ORDER: 1 | |
ALLOW_NEGATIVE_FORMULA_ERROR_ON_ANY_LINK_PRESENT: 1 | |
sdnadll: 'c:\Program Files (x86)\sDNA\x64\sdna_vs2008.dll' | |
sdna_debug: "" |