-
Notifications
You must be signed in to change notification settings - Fork 1
412 lines (358 loc) · 14.3 KB
/
CI-intel.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
name: CI-Win-Intel
on: [push]
# if there is a version tag, build release and push.
# From now (Jul 21) use semantic version number e.g. v15.2.103 (major.minor.patch)
# The old system has a hardcoded version (e.g. 15.1) and a build number instead of a patch.
# The build number was the number of commits on current branch. Instead, let's store
# the end of the git commit hash as a unique id to identify this build.
env:
WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/c961e083-5685-4f0b-ada5-c6cf16f561dd/w_BaseKit_p_2023.1.0.47256_offline.exe
WINDOWS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/2a13d966-fcc5-4a66-9fcc-50603820e0c9/w_HPCKit_p_2023.1.0.46357_offline.exe
WINDOWS_MKL_COMPONENTS: intel.oneapi.win.mkl.devel
WINDOWS_FORTRAN_COMPONENTS: intel.oneapi.win.ifort-compiler
jobs:
# # Delete the following if you don't want to save install logs
# - name: Saving install logs
# if: steps.cache-install.outputs.cache-hit != 'true'
# uses: actions/upload-artifact@v2
# with:
# name: InstallLogs_${{ github.job }}
# path: |
# extract.log
# bootstrapper*
# installer*
# retention-days: 7
# # Delete the following if you don't want to save install logs
# - name: Saving install logs
# if: steps.cache-install.outputs.cache-hit != 'true'
# uses: actions/upload-artifact@v2
# with:
# name: InstallLogs_${{ github.job }}
# path: |
# extract.log
# bootstrapper*
# installer*
# retention-days: 7
build:
runs-on: windows-2019
env:
testfail: false
strategy:
fail-fast: false
matrix:
cl: [gui, nogui]
release: [debug, release]
include:
# Setup some GUI/NOGUI specific variables
- cl: gui
guiflag: yes
testsuffix: GUI
removeguitst:
wxoptions: -DwxWidgets_ROOT_DIR=..\wx -DwxWidgets_LIB_DIR=..\wx\lib\vc14x_x64_dll -DwxWidgets_CONFIGURATION=mswu
- cl: nogui
guiflag: no
testsuffix:
removeguitst: del gui.tst
wxoptions:
- release: debug
testoption: -s
- release: release
testoption:
steps:
- name: Checkout crystals
uses: actions/checkout@v4
# - name: Add msbuild to PATH
# uses: microsoft/setup-msbuild@v1.0.2
- name: cache install oneapi
id: cache-install-oneapi
uses: actions/cache@v4
with:
path: C:\Program Files (x86)\Intel\oneAPI
key: install-${{ env.WINDOWS_BASEKIT_URL }}-${{ env.WINDOWS_MKL_COMPONENTS }}-mkl-${{ env.WINDOWS_HPCKIT_URL }}-${{ env.WINDOWS_FORTRAN_COMPONENTS }}-${{ hashFiles('**/bin/cache_exclude_windows.sh') }}
- name: install oneapi
shell: bash
if: steps.cache-install-oneapi.outputs.cache-hit != 'true'
run: |
bin/install_windows.bat $WINDOWS_BASEKIT_URL $WINDOWS_MKL_COMPONENTS mklinst
bin/install_windows.bat $WINDOWS_HPCKIT_URL $WINDOWS_FORTRAN_COMPONENTS ifortinst
- name: exclude unused files from cache oneapi
if: steps.cache-install-oneapi.outputs.cache-hit != 'true'
shell: bash
run: bin/cache_exclude_windows.sh
- name: Upload outputs if install fail
uses: actions/upload-artifact@v4
if: failure()
with:
name: install-fail-logs-win64-${{ matrix.cl }}
path: .
# Install wxWidgets - win GUI only
- name: cache install wx
id: cache-wxlibs # give it a name for checking the cache hit-or-not
uses: actions/cache@v4
with:
path: ./wx # what we cache: the folder
key: ${{ runner.os }}-wxlibs314
restore-keys: |
${{ runner.os }}-wxlibs314
if: matrix.cl == 'gui'
- name: Download wxWidgets for Win64 gui
if: ${{ steps.cache-wxlibs.outputs.cache-hit != 'true' && matrix.cl == 'gui' }}
shell: cmd
run: |
curl -LsS https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.4/wxMSW-3.1.4_vc14x_x64_Dev.7z > dev.7z
curl -LsS https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.4/wxWidgets-3.1.4-headers.7z > head.7z
curl -LsS https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.4/wxMSW-3.1.4_vc14x_x64_ReleaseDLL.7z > rel.7Z
7z x dev.7z -owx -y
7z x head.7z -owx -y
7z x rel.7z -owx -y
dir
#
- name: Create build and install folder
run: |
mkdir ci
mkdir installer
- name: Process version of the tag
uses: dhkatz/get-version-action@v3.0.0
id: version
- name: Get short SHA of commit
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Check outputs
run: |
echo SHA: ${{ steps.vars.outputs.sha_short }}
echo Major: ${{ steps.version.outputs.major }} Minor: ${{ steps.version.outputs.minor }}
echo Ref: ${{github.ref_name}}
- name: Build custom mkl library
working-directory: ci
shell: cmd
run: |
call ..\bin\fix_cached_intelcomp.bat
for /f "tokens=* usebackq" %%f in (`dir /b "C:\Program Files (x86)\Intel\oneAPI\compiler\" ^| findstr /V latest ^| sort`) do @set "LATEST_VERSION=%%f"
xcopy /I/E/Y "C:\Program Files (x86)\Intel\oneAPI\mkl\%LATEST_VERSION%\tools\builder" builder
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
set FC=ifort
pushd builder
nmake libintel64 export="..\..\build\mkllibs.txt"
popd
copy ".\builder\mkl_custom.dll" .
copy ".\builder\mkl_custom.lib" .
# Build WIN64
#
- uses: ilammy/msvc-dev-cmd@v1
- name: Build CRYSTALS intel64
working-directory: ci
shell: cmd
run: |
for /f "tokens=* usebackq" %%f in (`dir /b "C:\Program Files (x86)\Intel\oneAPI\compiler\" ^| findstr /V latest ^| sort`) do @set "LATEST_VERSION=%%f"
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
set FC=ifort
set CRYSVNVER=${{ steps.vars.outputs.sha_short }}
echo Commit SHA: %CRYSVNVER% Version: ${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }}
cmake .. -G"NMake Makefiles" -DuseGUI=${{ matrix.guiflag }} -DCMAKE_SH="CMAKE_SH-NOTFOUND" ${{ matrix.wxoptions }} -DCMAKE_BUILD_TYPE=${{ matrix.release }} -DuseCustomMKL=yes -DusePY=no -DCMAKE_EXPORT_COMPILE_COMMANDS=on
nmake || exit /b %ERRORLEVEL%
copy ..\wx\lib\vc14x_x64_dll\wxmsw314u_stc_vc14x_x64.dll .
copy ..\wx\lib\vc14x_x64_dll\wxmsw314u_core_vc14x_x64.dll .
copy ..\wx\lib\vc14x_x64_dll\wxmsw314u_gl_vc14x_x64.dll .
copy ..\wx\lib\vc14x_x64_dll\wxbase314u_vc14x_x64.dll .
SET COMMAND=where libifcoremd.dll
FOR /F "delims=" %%A IN ('%COMMAND%') DO (
SET TEMPVAR=%%A
GOTO :copy1
)
:copy1
ECHO %TEMPVAR%
copy "%tempvar%"
SET COMMAND=where libifportMD.dll
FOR /F "delims=" %%A IN ('%COMMAND%') DO (
SET TEMPVAR=%%A
GOTO :copy2
)
:copy2
ECHO %TEMPVAR%
copy "%tempvar%"
SET COMMAND=where libiomp5md.dll
FOR /F "delims=" %%A IN ('%COMMAND%') DO (
SET TEMPVAR=%%A
GOTO :copy3
)
:copy3
ECHO %TEMPVAR%
copy "%tempvar%"
SET COMMAND=where libmmd.dll
FOR /F "delims=" %%A IN ('%COMMAND%') DO (
SET TEMPVAR=%%A
GOTO :copy5
)
:copy5
ECHO %TEMPVAR%
copy "%tempvar%"
SET COMMAND=where svml_dispmd.dll
FOR /F "delims=" %%A IN ('%COMMAND%') DO (
SET TEMPVAR=%%A
GOTO :copy6
)
:copy6
ECHO %TEMPVAR%
copy "%tempvar%"
SET COMMAND=where msvcp140.dll
FOR /F "delims=" %%A IN ('%COMMAND%') DO (
SET TEMPVAR=%%A
GOTO :copy7
)
:copy7
ECHO %TEMPVAR%
copy "%tempvar%"
SET COMMAND=where vcruntime140.dll
FOR /F "delims=" %%A IN ('%COMMAND%') DO (
SET TEMPVAR=%%A
GOTO :copy8
)
:copy8
ECHO %TEMPVAR%
copy "%tempvar%"
SET COMMAND=where vcruntime140_1.dll
FOR /F "delims=" %%A IN ('%COMMAND%') DO (
SET TEMPVAR=%%A
GOTO :copy9
)
:copy9
ECHO %TEMPVAR%
copy "%tempvar%"
# Tests
- uses: ilammy/msvc-dev-cmd@v1
- name: Test CRYSTALS windows
working-directory: test_suite
shell: cmd
# Prevent interactive scripts from running
# Prevent gui test from running for this cl version
# Setup environment
# Compcode sets folder with reference test outputs
# Go
run: |
set CRYSDIR=.\,..\ci\
set COMPCODE=INW64GH${{ matrix.testsuffix }}
set OMP_NUM_THREADS=1
set PATH=..\wx\lib\vc14x_x64_dll;%path%
for /f "tokens=* usebackq" %%f in (`dir /b "C:\Program Files (x86)\Intel\oneAPI\compiler\" ^| findstr /V latest ^| sort`) do @set "LATEST_VERSION=%%f"
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
echo PATH is %PATH%
echo CRYSDIR is %CRYSDIR%
ren INW64GH${{ matrix.testsuffix }}.org safe.dir
for /d %%G in ("*.org") do rd /s /q "%%~G"
ren safe.dir INW64GH${{ matrix.testsuffix }}.org
${{ matrix.removeguitst }}
mkdir script
echo "%SCRIPT NONE" > script\\tipauto.scp
echo "%END SCRIPT" >> script\\tipauto.scp
echo "%SCRIPT NONE" > script\\guideauto.scp
echo "%END SCRIPT" >> script\\guideauto.scp
perl ../editor/filepp.pl -ds -w -o diffin.tst -DTESTWIN diffin.tss
perl ../editor/filepp.pl -ds -w -o diffin2.tst -DTESTWIN diffin2.tss
perl ../editor/filepp.pl -ds -w -o diffin3.tst -DTESTWIN diffin3.tss
perl ../editor/filepp.pl -ds -w -o shelx2cry.tst -DTESTWIN shelx2cry.tss
perl testsuite.pl ${{ matrix.testoption }} -l
# If failures, trigger next two stages (one to tidy, one to upload)
- name: Tidy failed test outputs win64
working-directory: test_suite
if: failure()
shell: cmd
run: |
dir
echo "testfail=true" >> $GITHUB_ENV
del /q INW64GH${{ matrix.testsuffix }}.org
copy *.out INW64GH${{ matrix.testsuffix }}.org
del /q *.*
- name: Upload outputs if failures
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-outputs-win64-${{ matrix.cl }}
path: test_suite
# Could be useful for debugging
# - name: Upload exe folder if failures
# uses: actions/upload-artifact@v1
# if: failure()
# with:
# name: executable-outputs-win64-${{ matrix.cl }}
# path: ci
# Could be useful for debugging
- name: Upload compile_commands
uses: actions/upload-artifact@v4
with:
name: commands-win64-${{ matrix.cl }}-${{ matrix.release }}
path: ci/compile_commands.json
- name: Build installer
if: ${{ matrix.cl == 'gui' }}
working-directory: installer
shell: cmd
run: |
set CRYSVNVER=${{ steps.vars.outputs.sha_short }}
set CRYSEMVER=${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }}
echo Commit SHA: %CRYSVNVER% Version: %CRYSEMVER%
IF "%CRYSVNVER%"=="" (SET CRYSVNVER=0000)
IF "%CRYSEMVER%"=="" (SET CRYSEMVER=10.1.100)
"C:\Program Files (x86)\Inno Setup 6\iscc.exe" "../bin/crystals-gh.iss"
ren crystals-setup.exe crystals-${{steps.version.outputs.version}}-${{steps.vars.outputs.sha_short}}-${{matrix.release}}-setup.exe
# - uses: ChemCryst/code-sign-action@2cf2f6795b8a52517aeb27d1c570614edb6a6018
# with:
# certificate: '${{ secrets.CERTIFICATE }}'
# password: '${{ secrets.PASSWORD }}'
# certificatesha1: '${{ secrets.CERTHASH }}'
# certificatename: '${{ secrets.CERTNAME }}'
# folder: 'installer'
# recursive: false
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: crystals-setup-${{ matrix.release }}
path: ./installer/crystals-${{steps.version.outputs.version}}-${{steps.vars.outputs.sha_short}}-${{matrix.release}}-setup.exe
if: ${{ matrix.cl == 'gui' }}
- name: Create Release
if: ${{ matrix.cl == 'gui' && matrix.release == 'release' && startsWith(github.ref, 'refs/tags/') }}
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: Tag-${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Store Release url
if: ${{ matrix.cl == 'gui' && matrix.release == 'release' && startsWith(github.ref, 'refs/tags/') }}
run: |
echo "${{ steps.create_release.outputs.upload_url }}" > ./upload_url
- uses: actions/upload-artifact@v4
with:
path: ./upload_url
name: upload_url
if: ${{ matrix.cl == 'gui' && matrix.release == 'release' && startsWith(github.ref, 'refs/tags/') }}
#upload assets to release
- name: Download URL
if: ${{ matrix.cl == 'gui' && matrix.release == 'release' && startsWith(github.ref, 'refs/tags/') }}
uses: actions/download-artifact@v4
with:
name: upload_url
path: ./
# - id: set_upload_url
# if: ${{ matrix.cl == 'gui' && matrix.release == 'release' && startsWith(github.ref, 'refs/tags/')}}
# run: echo "upload_url=$(cat ./upload_url)" >> $GITHUB_OUTPUT
# - name: Upload to Release
#uses: actions/upload-release-asset@v1.0.1
#env:
#GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#with:
#upload_url: ${{ steps.set_upload_url.outputs.upload_url }}
#asset_path: ./installer/crystals-setup.exe
#asset_name: crystals-v${{ env.VERSION }}-win64.exe
#asset_content_type: application/x-executable
#if: ${{ matrix.cl == 'gui' && matrix.release == 'release' }}
# if: startsWith(github.ref, 'refs/tags/')
- name: Upload to Release
uses: softprops/action-gh-release@v1
if: ${{ matrix.cl == 'gui' && matrix.release == 'release' && startsWith(github.ref, 'refs/tags/') }}
with:
files: |
./installer/crystals-*-${{matrix.release}}-setup.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}