First stab at adding basic windows MSVC test #41
Workflow file for this run
This file contains hidden or 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: mcstas-winbasictest | |
| on: | |
| push: | |
| pull_request: | |
| 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-2019, windows-2022] | |
| 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 | |
| #Two ways of enabling cl.exe and other tools. One is via an external action...: | |
| - name: Setup VS in shell | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| #...but a simpler one might be to simply invoke the correct vcvars64.bat | |
| #file first, like...: | |
| # | |
| # - name: whatever | |
| # shell: cmd | |
| # run: | | |
| # call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
| # cl /help | |
| # | |
| #...but since we also want to support VS 2019, we use the above action for now | |
| - name: choco install deps | |
| run: choco install winflexbison3 wget | |
| - name: CMake cfg | |
| run: > | |
| cmake -B build -S src | |
| "-DCMAKE_INSTALL_PREFIX=./install" | |
| -DMCVERSION="3.99.99" | |
| -DMCCODE_BUILD_CONDA_PKG=OFF | |
| -DCMAKE_INSTALL_LIBDIR=lib | |
| -DBUILD_MCSTAS=ON | |
| -DMCCODE_USE_LEGACY_DESTINATIONS=OFF | |
| -DBUILD_TOOLS=ON | |
| -DENABLE_COMPONENTS=ON | |
| -DENABLE_CIF2HKL=OFF | |
| -DENABLE_NEUTRONICS=OFF | |
| - name: CMake build | |
| shell: cmd | |
| run: cmake --build build --config Release -j 2 | |
| - name: CMake install | |
| run: cmake --install build --config Release | |
| - name: pip install deps | |
| run: pip install PyYAML ply McStasscript ncrystal mslex | |
| - name: pip install mcpl-core preview | |
| run: pip install -v "git+https://github.com/mctools/mcpl@path_to_mcpl2#subdirectory=mcpl_core" | |
| - name: set MCSTAS env var | |
| run: echo MCSTAS=%CD%\install\share\mcstas\resources >> %GITHUB_ENV% | |
| - name: check MCSTAS env var | |
| run: echo %MCSTAS% | |
| - run: .\install\bin\mcrun -h | |
| - run: .\install\bin\mcstas -v | |
| - run: mcpl-config -s | |
| - run: ncrystal-config -s | |
| - run: type .\install\share\mcstas\tools\Python\mccodelib\mccode_config.json | |
| - name: Prepare rundirs | |
| run: mkdir run_std run_mcpl run_union run_ncrystal | |
| - name: Prepare std instrument | |
| working-directory: run_std | |
| run: copy ..\install\share\mcstas\resources\examples\BNL\BNL_H8\BNL_H8.instr test.instr | |
| - name: Run | |
| working-directory: run_std | |
| run: ..\install\bin\mcrun.bat --verbose test.instr lambda=2.36 | |
| - name: Prepare NCrystal instrument | |
| working-directory: run_ncrystal | |
| run: copy ..\install\share\mcstas\resources\examples\NCrystal\NCrystal_example\NCrystal_example.instr test.instr | |
| - name: Run | |
| working-directory: run_ncrystal | |
| run: ..\install\bin\mcrun --verbose test.instr sample_cfg="Y2O3_sg206_Yttrium_Oxide.ncmat;density=0.6x" |