-
Notifications
You must be signed in to change notification settings - Fork 1
149 lines (110 loc) · 4.65 KB
/
build_installer_using_cmake_and_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
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: ""