-
Notifications
You must be signed in to change notification settings - Fork 62
213 lines (172 loc) · 6.9 KB
/
mcstas-winbasictest-mingw.yml
File metadata and controls
213 lines (172 loc) · 6.9 KB
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
name: mcstas-mingw-winbasictest
on:
push:
pull_request:
schedule:
- cron: '55 23 * * 0' # 23:55 every Sunday
jobs:
build:
# More platform information available on:
# https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md
runs-on: ${{ matrix.os }}
defaults:
run:
shell: cmd
strategy:
matrix:
os: [windows-2022]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: src
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Setup MPI
uses: mpi4py/setup-mpi@v1
with:
mpi: 'msmpi'
- name: Setup MPI cygpath bash...
shell: bash
run: |
cygpath -sm "$MSMPI_INC" > includepath.txt
cygpath -sm "$MSMPI_LIB64" > libpath.txt
- name: Setup MPI cygpath...
run: |
set /p MPIINCVAR=<includepath.txt
set /p MPILIBVAR=<libpath.txt
echo MPIINCVAR=%MPIINCVAR% >> %GITHUB_ENV%
echo MPILIBVAR=%MPILIBVAR% >> %GITHUB_ENV%
- name: choco install wget
run: choco install wget
- name: pip install deps
run: pip install PyYAML ply McStasscript ncrystal mslex mcpl mcpl-extra
- name: choco install deps2
run: choco install mingw make winflexbison3
- name: CMake cfg
run: >
cmake -B build -S src
-G "Unix Makefiles"
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc.exe
"-DCMAKE_INSTALL_PREFIX=./install"
-DMCVERSION="3.99.99"
-DMCCODE_BUILD_CONDA_PKG=OFF
-DMCCODE_BUILD_WINDOWS_MINGW=ON
-DMCCODE_CONFIG_MCPL2=ON
-DCMAKE_INSTALL_LIBDIR=lib
-DBUILD_MCSTAS=ON
-DMCCODE_USE_LEGACY_DESTINATIONS=OFF
-DBUILD_TOOLS=ON
-DENABLE_COMPONENTS=ON
-DENABLE_CIF2HKL=ON
-DENABLE_NEUTRONICS=OFF
-DMPIINCLUDEDIR=%MPIINCVAR%
-DMPILIBDIR=%MPILIBVAR%
- name: CMake build
shell: cmd
run: cmake --build build --config Release -j 2
- name: CMake install
run: cmake --install build --config Release
- name: set MCSTAS env var
run: echo MCSTAS=%CD%\install\share\mcstas\resources >> %GITHUB_ENV%
- name: check MCSTAS env var
run: echo %MCSTAS%
- run: type .\install\share\mcstas\tools\Python\mccodelib\mccode_config.json
- run: .\install\bin\mcrun -h
- run: .\install\bin\mcstas -v
- run: mcpl-config -s
- run: ncrystal-config -s
- name: Prepare rundirs
run: mkdir run_rng run_std run_mcpl_output run_mcpl_input run_mcpl_input_once run_union run_ncrystal
- name: Prepare rng instrument
working-directory: run_rng
run: copy ..\install\share\mcstas\resources\examples\Tests_RNG\Test_RNG_rand01\Test_RNG_rand01.instr test.instr
- name: Prepare std instrument
working-directory: run_std
run: copy ..\install\share\mcstas\resources\examples\BNL\BNL_H8\BNL_H8.instr test.instr
- name: Prepare NCrystal instrument
working-directory: run_ncrystal
run: copy ..\install\share\mcstas\resources\examples\NCrystal\NCrystal_example\NCrystal_example.instr test.instr
- name: Prepare MCPL_input instrument
working-directory: run_mcpl_input
run: |
copy ..\install\share\mcstas\resources\examples\Tests_MCPL_etc\Test_MCPL_input\Test_MCPL_input.instr test.instr
copy ..\install\share\mcstas\resources\examples\Tests_MCPL_etc\Test_MCPL_input\voutput.mcpl.gz .
- name: Prepare MCPL_input_once instrument
working-directory: run_mcpl_input_once
run: |
copy ..\install\share\mcstas\resources\examples\Tests_MCPL_etc\Test_MCPL_input_once\Test_MCPL_input_once.instr test.instr
copy ..\install\share\mcstas\resources\examples\Tests_MCPL_etc\Test_MCPL_input_once\voutput.mcpl.gz .
- name: Prepare MCPL_output instrument
working-directory: run_mcpl_output
run: copy ..\install\share\mcstas\resources\examples\Tests_MCPL_etc\Test_MCPL_output\Test_MCPL_output.instr test.instr
- name: Run rng instrument
working-directory: run_rng
run: ..\install\bin\mcrun --verbose test.instr -s1000 seed=1000 -d RNGtest
- name: Test RNG instrument output
working-directory: run_rng
shell: bash
run: |
export SUM=`grep -v \# RNGtest/rngout.dat | dos2unix | md5sum | cut -f1 -d\ `
export EXPECTED="f192ce4609e2225bf9d42ce9c5fa5a86"
if [ "${EXPECTED}" == "${SUM}" ];
then
echo RNG test success!
true
else
echo RNG test failure!
false
fi
- name: Run std instrument
working-directory: run_std
run: ..\install\bin\mcrun --verbose test.instr -d Single_core lambda=2.36
- name: Run MCPL_output instrument
working-directory: run_mcpl_output
run: ..\install\bin\mcrun --verbose test.instr -d Single_core Ncount=1e3
- name: Run MCPL_input instrument
working-directory: run_mcpl_input
run: ..\install\bin\mcrun --verbose test.instr -d Single_core repeat=1
- name: Run MCPL_input_once instrument
working-directory: run_mcpl_input_once
run: ..\install\bin\mcrun --verbose test.instr -d Single_core v_smear=0.1
- name: Run NCrystal instrument
working-directory: run_ncrystal
run: ..\install\bin\mcrun --verbose test.instr -d Single_core sample_cfg="Y2O3_sg206_Yttrium_Oxide.ncmat;density=0.6x"
- name: Run std instrument MPI
working-directory: run_std
run: ..\install\bin\mcrun --verbose test.instr -d MPI_multicore -c --mpi=auto lambda=2.36
- name: Run MCPL_output instrument MPI
working-directory: run_mcpl_output
run: ..\install\bin\mcrun --verbose test.instr -d MPI_multicore -c --mpi=auto Ncount=1e3
- name: Run MCPL_input instrument MPI
working-directory: run_mcpl_input
run: ..\install\bin\mcrun --verbose test.instr -d MPI_multicore -c --mpi=auto repeat=1
- name: Run MCPL_input_once instrument MPI
working-directory: run_mcpl_input_once
run: ..\install\bin\mcrun --verbose test.instr -d MPI_multicore -c --mpi=auto v_smear=0.1
- name: Run NCrystal instrument MPI
working-directory: run_ncrystal
run: ..\install\bin\mcrun --verbose test.instr -d MPI_multicore -c --mpi=auto sample_cfg="Y2O3_sg206_Yttrium_Oxide.ncmat;density=0.6x"
- name: 'Tar output files'
id: tar-package
if: always()
shell: bash
run: |
set -e
set -u
set -x
tar cvfz mcstas-mingw-${{ matrix.os }}_output.tgz run_*
- name: 'Upload Artifact'
id: tar-upload
uses: actions/upload-artifact@v4
if: always()
with:
name: mcstas-mingw-${{ matrix.os }}_output.tgz
path: "mcstas-mingw-${{ matrix.os }}_output.tgz"
- name: Setup tmate session for manual debugging
uses: mxschmitt/action-tmate@v3
if: always() && (inputs.manual-debugging == true)
with:
limit-access-to-actor: true