CI: Work on windows workflows #206
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: basictest_win | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: src | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
#- name: Pip upgrade | |
# shell: cmd | |
# run: | | |
# python3 -m pip install -U pip | |
# python3 -m pip install -U setuptools | |
# python3 -m pip install -U scikit-build-core | |
#NB: We don't test matplotlib import here in the next step, since we want | |
#to make sure that our CTest infrastructure correctly avoids problems from | |
#"building font cache" printouts on first imports. | |
- name: pip install extra deps | |
shell: cmd | |
run: | | |
python -mpip install numpy matplotlib gemmi spglib ase mpmath | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
python -c "import numpy; print('numpy imported ok')" | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
python -c "import gemmi; print('gemmi imported ok')" | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
python -c "import spglib; print('spglib imported ok')" | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
python -c "import ase; print('ase imported ok')" | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
python -c "import mpmath; print('mpmath imported ok')" | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
- name: Monolithic pip install of repo | |
shell: cmd | |
run: python3 -m pip install .\src\ | |
- name: Various commandline tests | |
shell: cmd | |
run: | | |
ncrystal-config --summary | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
ncrystal-config --help | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
python3 -c "import NCrystal; NCrystal.test()" | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
python3 -c "import NCrystal as n; mat=n.load('Al_sg225.ncmat;temp=350K'); mat.dump()" | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
nctool --test | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
nctool --dump Al_sg225.ncmat | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
python3 -mNCrystal nctool --test | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
python3 ./src/examples/ncrystal_example_py | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
ncrystal_vdos2ncmat --help | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
ncrystal_cif2ncmat --help | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
ncrystal_ncmat2cpp --help | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
ncrystal_hfg2ncmat --help | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
ncrystal_verifyatompos --help | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
ncrystal_cif2ncmat codid::9008460 | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
ncrystal_ncmat2hkl --help | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
ncrystal_ncmat2hkl --format=laz 'Al_sg225.ncmat;temp=250K;dcutoff=0.75' -o test_Al.laz | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
ncrystal_ncmat2hkl --format=lau 'Al_sg225.ncmat;temp=250K;dcutoff=0.75' -o test_Al.lau | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
nctool -d ./test_Al.laz | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
nctool -d ./test_Al.lau | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
ncrystal_ncmat2cpp $(ncrystal-config --show datadir)/Al_sg225.ncmat -o test.cpp | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
cat test.cpp | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
nctool --pdf Al_sg225.ncmat | |
if %errorlevel% neq 0 then exit /b %errorlevel% | |
- name: Fix path | |
run: echo "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.42.34433\bin\Hostx64\x64" >> $GITHUB_PATH | |
- name: Find cl.exe | |
shell: cmd | |
run: | | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
cl /help | |
cl.exe /help | |
call "C:\Program Files\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" | |
cl /help | |
cl.exe /help |