Skip to content
Merged
26 changes: 15 additions & 11 deletions .github/workflows/mcstas-basictest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- { method: conda, os: ubuntu-latest, CC: gcc, CXX: g++, python: '3.13', mpi: 'openmpi', nmpi: 'auto', cogen: 'classic'}
- { method: conda, os: ubuntu-latest, CC: gcc, CXX: g++, python: '3.13', mpi: 'openmpi', nmpi: 'auto', cogen: 'antlr'}
- { method: conda, os: macos-latest, CC: clang, CXX: clang++, python: '3.13', mpi: 'openmpi', nmpi: '2', cogen: 'classic'}
- { method: conda, os: windows-latest, CC: cl.exe, CXX: cl.exe, python: "3.13", mpi: 'msmpi', nmpi: 'auto', cogen: 'classic'}
- { method: conda, os: windows-latest, CC: CL, CXX: CL, python: "3.13", mpi: 'msmpi', nmpi: 'auto', cogen: 'classic'}

name: ${{ matrix.os }}.${{ matrix.method }}.${{ matrix.cogen }}.${{ matrix.CC || 'default' }}.${{ matrix.mpi }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -110,13 +110,15 @@ jobs:
echo MPIINCVAR=%MPIINCVAR% >> %GITHUB_ENV%
echo MPILIBVAR=%MPILIBVAR% >> %GITHUB_ENV%

- name: Check versions
- name: Check versions and set worker label
id: version-checks
run: |
which python3
python3 --version
which cmake
cmake --version
MYWORKERID=`echo ${RUNNER_TRACKING_ID} | md5sum | cut -c1-12`
echo MYWORKERID=${MYWORKERID} >> "$GITHUB_ENV"

- name: Get conda dependency list
id: conda-deps
Expand All @@ -133,7 +135,7 @@ jobs:

- name: Configure build and install mcstas (source)
id: mcstas-install
if: ${{ matrix.method == 'source' && matrix.CC != 'cl.exe' }}
if: ${{ matrix.method == 'source' && matrix.CC != 'CL' }}
run: |
if [ "$RUNNER_OS" == "macOS" ]; then mkdir ${HOME}/tmp; fi
if [ "$RUNNER_OS" == "macOS" ]; then export SDKROOT=$(xcrun --sdk macosx --show-sdk-path); fi
Expand Down Expand Up @@ -231,7 +233,7 @@ jobs:
type .\install_mcstas\share\mcstas\tools\Python\mccodelib\mccode_config.json
.\install_mcstas\bin\mcrun -h
.\install_mcstas\bin\mcstas -v
if [ "${{ matrix.CC }}" != "cl.exe" ];
if [ "${{ matrix.CC }}" != "CL" ];
then
mcpl-config -s
ncrystal-config -s
Expand Down Expand Up @@ -346,7 +348,7 @@ jobs:
fi
test -n "$(command -v mcstas${EXESUFFIX})"
mcstas${EXESUFFIX} --version
mctest${SUFFIX} --instr=Test_RNG_rand01 --testdir=run_rngtest --suffix=${{ matrix.cogen }}_${{ matrix.method }} --uid=${RUNNER_TRACKING_ID}
mctest${SUFFIX} --instr=Test_RNG_rand01 --testdir=run_rngtest --suffix=${{ matrix.cogen }}_${{ matrix.method }} --uid=${MYWORKERID}
export SUM=`find run_rngtest -name rngout.dat | xargs -n1 grep -v \# | ${MD5SUM} | cut -f1 -d\ `
export EXPECTED="f192ce4609e2225bf9d42ce9c5fa5a86"
if [ "${EXPECTED}" == "${SUM}" ];
Expand Down Expand Up @@ -374,8 +376,8 @@ jobs:
fi
test -n "$(command -v mcstas${EXESUFFIX})"
mcstas${EXESUFFIX} --version
mctest${SUFFIX} --instr=BNL_H8,ISIS_CRISP,templateSANS_Mantid,NCrystal_example,ESS_BEER_MCPL,Test_MCPL_input,Test_MCPL_output,Test_KDSource --testdir=run_basictests --suffix=${{ matrix.cogen }}_${{ matrix.method }} --uid=${RUNNER_TRACKING_ID}
mctest${SUFFIX} --mpi=${{ matrix.nmpi }} --instr=BNL_H8,ISIS_CRISP,templateSANS_Mantid,NCrystal_example,ESS_BEER_MCPL,Test_MCPL_input,Test_MCPL_output,Test_KDSource --testdir=run_basictests --suffix=${{ matrix.cogen }}_${{ matrix.method }}_${{ matrix.mpi }} --uid=${RUNNER_TRACKING_ID}
mctest${SUFFIX} --instr=BNL_H8,ISIS_CRISP,templateSANS_Mantid,NCrystal_example,ESS_BEER_MCPL,Test_MCPL_input,Test_MCPL_output,Test_KDSource --testdir=run_basictests --suffix=${{ matrix.cogen }}_${{ matrix.method }}_${{ matrix.CC || 'default' }} --uid=${MYWORKERID}
mctest${SUFFIX} --mpi=${{ matrix.nmpi }} --instr=BNL_H8,ISIS_CRISP,templateSANS_Mantid,NCrystal_example,ESS_BEER_MCPL,Test_MCPL_input,Test_MCPL_output,Test_KDSource --testdir=run_basictests --suffix=${{ matrix.cogen }}_${{ matrix.method }}_${{ matrix.CC || 'default' }}_${{ matrix.mpi }} --uid=${MYWORKERID}

- name: Check for modified instruments
id: instr-test
Expand Down Expand Up @@ -423,6 +425,7 @@ jobs:
export CHANGEDCOMPS=`git diff --name-only $DIFFBASE HEAD | grep \.comp\$ | grep mcstas-comps | xargs -n1 basename | sed s/\.comp//g | sort | uniq | xargs echo`
export NUMCHANGEDCOMPS=`git diff --name-only $DIFFBASE HEAD | grep \.comp\$ | grep mcstas-comps | wc -l | xargs echo`
cd -
compindex=0
if [ "$NUMCHANGEDCOMPS" != "0" ];
then
for comp in $CHANGEDCOMPS;
Expand All @@ -431,7 +434,8 @@ jobs:
NUMMATCH=`find src/mcstas-comps -name \*.instr -exec grep -H ${comp} \{\} \; | cut -f1 -d: | sort | uniq | wc -l`
if [ "$NUMMATCH" -gt "0" ];
then
${MCTEST_EXECUTABLE} --mpi=${{ matrix.nmpi }} --testdir run_mctest --comp=${comp} --suffix=${{ matrix.cogen }}_CHANGES_${comp}_${{ matrix.method }}_${{ matrix.CC || 'default' }}_${{ matrix.mpi }} $PERMISSIVE --verbose --uid=${RUNNER_TRACKING_ID} || { echo "${MCTEST_EXECUTABLE} failed with exit code $?"; exit 1; }
${MCTEST_EXECUTABLE} --mpi=${{ matrix.nmpi }} --testdir run_mctest --comp=${comp} --suffix=${{ matrix.cogen }}_CHANGES${compindex}_${{ matrix.method }}_${{ matrix.CC || 'default' }}_${{ matrix.mpi }} $PERMISSIVE --verbose --uid=${MYWORKERID} || { echo "${MCTEST_EXECUTABLE} failed with exit code $?"; exit 1; }
compindex=$(( compindex+1 ))
else
echo No matching tests found
fi
Expand Down Expand Up @@ -460,7 +464,7 @@ jobs:
export SCOPE=" "
fi
mkdir -p run_mctest && cd run_mctest
${MCTEST_EXECUTABLE} --mpi=${{ matrix.nmpi }} --testdir $PWD $SCOPE --suffix=CHANGES_${{ matrix.cogen }}_${{ matrix.method }}_${{ matrix.CC || 'default' }}_${{ matrix.mpi }} $PERMISSIVE --verbose --uid=${RUNNER_TRACKING_ID} || { echo "${MCTEST_EXECUTABLE} failed with exit code $?"; exit 1; }
${MCTEST_EXECUTABLE} --mpi=${{ matrix.nmpi }} --testdir $PWD $SCOPE --suffix=instrCHANGES_${{ matrix.cogen }}_${{ matrix.method }}_${{ matrix.CC || 'default' }}_${{ matrix.mpi }} $PERMISSIVE --verbose --uid=${MYWORKERID} || { echo "${MCTEST_EXECUTABLE} failed with exit code $?"; exit 1; }
${MCVIEWTEST_EXECUTABLE} --nobrowse $PWD
fi

Expand All @@ -473,15 +477,15 @@ jobs:
set -x
# Clear out binaries from sim dir and tar up artifact
ls | grep run_ | xargs -n1 ./src/devel/bin/mccode-simdir-cleanfiles -d
tar cvfz mmcstas-${{ matrix.cogen }}.${{ matrix.os }}.${{ matrix.CC }}.${{ matrix.mpi }}.python-${{ matrix.python }}_output.tgz run_*
tar cvfz mcstas-${{ matrix.cogen }}.${{ matrix.os }}.${{ matrix.CC }}.${{ matrix.mpi }}.python-${{ matrix.python }}_output.tgz run_*

- name: 'Upload Artifact'
id: tar-upload
uses: actions/upload-artifact@v6
if: always()
with:
name: mcstas-artefacts-${{ matrix.cogen }}.${{ matrix.os }}.${{ matrix.CC }}.${{ matrix.mpi }}.python-${{ matrix.python }}
path: "mmcstas-${{ matrix.cogen }}.${{ matrix.os }}.${{ matrix.CC }}.${{ matrix.mpi }}.python-${{ matrix.python }}_output.tgz"
path: "mcstas-${{ matrix.cogen }}.${{ matrix.os }}.${{ matrix.CC }}.${{ matrix.mpi }}.python-${{ matrix.python }}_output.tgz"

- name: Setup tmate session for manual debugging
uses: mxschmitt/action-tmate@v3
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/mcstas-conda-testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ jobs:
environment-name: mcstas
environment-file: dependencies.yml

- name: Check versions
- name: Check versions and set worker label
id: version-checks
run: |
which python3
python3 --version
which cmake
cmake --version
MYWORKERID=`echo ${RUNNER_TRACKING_ID} | md5sum | cut -c1-12`
echo MYWORKERID=${MYWORKERID} >> "$GITHUB_ENV"

- name: Configure build and install mcstas
id: mcstas-install
Expand Down Expand Up @@ -126,7 +128,7 @@ jobs:
export TMPDIR=${HOME}/tmp
fi
# Run the test with 2 core mpi
${MCTEST_EXECUTABLE} --verbose --testdir $PWD --suffix ${{ matrix.cogen }}_${{ matrix.os }}_${{ matrix.mpi }} --mpi=${{ matrix.nmpi }} --uid=${RUNNER_TRACKING_ID}
${MCTEST_EXECUTABLE} --verbose --testdir $PWD --suffix ${{ matrix.cogen }}_${{ matrix.os }}_${{ matrix.mpi }} --mpi=${{ matrix.nmpi }} --uid=${MYWORKERID}
- name: 'Tar output files'
id: tar-package
if: always()
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/mcxtrace-basictest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- { method: conda, os: ubuntu-latest, CC: gcc, CXX: g++, python: '3.13', mpi: 'openmpi', nmpi: 'auto', cogen: 'classic'}
# - { method: conda, os: ubuntu-latest, CC: gcc, CXX: g++, python: '3.13', mpi: 'openmpi', nmpi: 'auto', cogen: 'antlr'}
- { method: conda, os: macos-latest, CC: clang, CXX: clang++, python: '3.13', mpi: 'openmpi', nmpi: '2', cogen: 'classic'}
- { method: conda, os: windows-latest, CC: cl.exe, CXX: cl.exe, python: "3.13", mpi: 'msmpi', nmpi: 'auto', cogen: 'classic'}
- { method: conda, os: windows-latest, CC: CL, CXX: CL, python: "3.13", mpi: 'msmpi', nmpi: 'auto', cogen: 'classic'}

name: ${{ matrix.os }}.${{ matrix.method }}.${{ matrix.cogen }}.${{ matrix.CC || 'default' }}.${{ matrix.mpi }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -118,13 +118,15 @@ jobs:
echo MPIINCVAR=%MPIINCVAR% >> %GITHUB_ENV%
echo MPILIBVAR=%MPILIBVAR% >> %GITHUB_ENV%

- name: Check versions
- name: Check versions and set worker label
id: version-checks
run: |
which python3
python3 --version
which cmake
cmake --version
MYWORKERID=`echo ${RUNNER_TRACKING_ID} | md5sum | cut -c1-12`
echo MYWORKERID=${MYWORKERID} >> "$GITHUB_ENV"

- name: Get conda dependency list
id: conda-deps
Expand All @@ -141,7 +143,7 @@ jobs:

- name: Configure build and install mcxtrace (source)
id: mcxtrace-install
if: ${{ matrix.method == 'source' && matrix.CC != 'cl.exe' }}
if: ${{ matrix.method == 'source' && matrix.CC != 'CL' }}
run: |
if [ "$RUNNER_OS" == "macOS" ]; then mkdir ${HOME}/tmp; fi
if [ "$RUNNER_OS" == "macOS" ]; then export SDKROOT=$(xcrun --sdk macosx --show-sdk-path); fi
Expand Down Expand Up @@ -240,7 +242,7 @@ jobs:
type .\install_mcxtrace\share\mcxtrace\tools\Python\mccodelib\mccode_config.json
.\install_mcxtrace\bin\mxrun -h
.\install_mcxtrace\bin\mcxtrace -v
if [ "${{ matrix.CC }}" != "cl.exe" ];
if [ "${{ matrix.CC }}" != "CL" ];
then
mcpl-config -s
fi
Expand Down Expand Up @@ -353,7 +355,7 @@ jobs:
fi
test -n "$(command -v mcxtrace${EXESUFFIX})"
mcxtrace${EXESUFFIX} --version
mxtest${SUFFIX} --instr=Test_RNG_rand01 --testdir=run_rngtest --suffix=${{ matrix.method }} --uid=${RUNNER_TRACKING_ID}
mxtest${SUFFIX} --instr=Test_RNG_rand01 --testdir=run_rngtest --suffix=${{ matrix.cogen }}_${{ matrix.method }} --uid=${MYWORKERID}
export SUM=`find run_rngtest -name rngout.dat | xargs -n1 grep -v \# | ${MD5SUM} | cut -f1 -d\ `
export EXPECTED="f192ce4609e2225bf9d42ce9c5fa5a86"
if [ "${EXPECTED}" == "${SUM}" ];
Expand Down Expand Up @@ -381,8 +383,8 @@ jobs:
fi
test -n "$(command -v mcxtrace${EXESUFFIX})"
mcxtrace${EXESUFFIX} --version
mxtest${SUFFIX} --instr=JJ_SAXS,ESRF_BM29,Test_MCPL_input,Test_MCPL_output,Test_Absorption --testdir=run_basictests --suffix=${{ matrix.method }} --uid=${RUNNER_TRACKING_ID}
mxtest${SUFFIX} --mpi=${{ matrix.nmpi }} --instr=JJ_SAXS,ESRF_BM29,Test_MCPL_input,Test_MCPL_output,Test_Absorption --testdir=run_basictests --suffix=${{ matrix.cogen }}_${{ matrix.method }}_${{ matrix.mpi }} --uid=${RUNNER_TRACKING_ID}
mxtest${SUFFIX} --instr=JJ_SAXS,ESRF_BM29,Test_MCPL_input,Test_MCPL_output,Test_Absorption --testdir=run_basictests --suffix=${{ matrix.cogen }}_${{ matrix.method }}_${{ matrix.CC || 'default' }} --uid=${MYWORKERID}
mxtest${SUFFIX} --mpi=${{ matrix.nmpi }} --instr=JJ_SAXS,ESRF_BM29,Test_MCPL_input,Test_MCPL_output,Test_Absorption --testdir=run_basictests --suffix=${{ matrix.cogen }}_${{ matrix.method }}_${{ matrix.CC || 'default' }}_${{ matrix.mpi }} --uid=${MYWORKERID}

- name: Check for modified instruments
id: instr-test
Expand Down Expand Up @@ -430,6 +432,7 @@ jobs:
export CHANGEDCOMPS=`git diff --name-only $DIFFBASE HEAD | grep \.comp\$ | grep mcxtrace-comps | xargs -n1 basename | sed s/\.comp//g | sort | uniq | xargs echo`
export NUMCHANGEDCOMPS=`git diff --name-only $DIFFBASE HEAD | grep \.comp\$ | grep mcxtrace-comps | wc -l | xargs echo`
cd -
compindex=0
if [ "$NUMCHANGEDCOMPS" != "0" ];
then
for comp in $CHANGEDCOMPS;
Expand All @@ -438,7 +441,8 @@ jobs:
NUMMATCH=`find src/mcxtrace-comps -name \*.instr -exec grep -H ${comp} \{\} \; | cut -f1 -d: | sort | uniq | wc -l`
if [ "$NUMMATCH" -gt "0" ];
then
${MXTEST_EXECUTABLE} --mpi=${{ matrix.nmpi }} --testdir run_mxtest --comp=${comp} --suffix=${{ matrix.cogen }}_CHANGES_${comp}_${{ matrix.method }}_${{ matrix.CC || 'default' }}_${{ matrix.mpi }} $PERMISSIVE --verbose --uid=${RUNNER_TRACKING_ID} || { echo "${MXTEST_EXECUTABLE} failed with exit code $?"; exit 1; }
${MXTEST_EXECUTABLE} --mpi=${{ matrix.nmpi }} --testdir run_mxtest --comp=${comp} --suffix=${{ matrix.cogen }}_CHANGES${compindex}_${{ matrix.method }}_${{ matrix.CC || 'default' }}_${{ matrix.mpi }} $PERMISSIVE --verbose --uid=${MYWORKERID} || { echo "${MXTEST_EXECUTABLE} failed with exit code $?"; exit 1; }
compindex=$(( compindex+1 ))
else
echo No matching tests found
fi
Expand Down Expand Up @@ -467,7 +471,7 @@ jobs:
export SCOPE=" "
fi
mkdir -p run_mxtest && cd run_mxtest
${MXTEST_EXECUTABLE} --mpi=${{ matrix.nmpi }} --testdir $PWD $SCOPE --suffix=CHANGES_${{ matrix.cogen }}_${{ matrix.method }}_${{ matrix.CC || 'default' }}_${{ matrix.mpi }} $PERMISSIVE --verbose --uid=${RUNNER_TRACKING_ID} || { echo "${MXTEST_EXECUTABLE} failed with exit code $?"; exit 1; }
${MXTEST_EXECUTABLE} --mpi=${{ matrix.nmpi }} --testdir $PWD $SCOPE --suffix=instrCHANGES_${{ matrix.cogen }}_${{ matrix.method }}_${{ matrix.CC || 'default' }}_${{ matrix.mpi }} $PERMISSIVE --verbose --uid=${MYWORKERID} || { echo "${MXTEST_EXECUTABLE} failed with exit code $?"; exit 1; }
${MXVIEWTEST_EXECUTABLE} --nobrowse $PWD
fi

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/mcxtrace-conda-testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ jobs:
environment-file: dependencies.yml
environment-name: mcxtrace

- name: Check versions
- name: Check versions and set worker label
id: version-checks
run: |
which python3
python3 --version
which cmake
cmake --version
MYWORKERID=`echo ${RUNNER_TRACKING_ID} | md5sum | cut -c1-12`
echo MYWORKERID=${MYWORKERID} >> "$GITHUB_ENV"

- name: Configure build and install mcxtrace
id: mcxtrace-install
Expand Down Expand Up @@ -107,7 +109,7 @@ jobs:
export TMPDIR=${HOME}/tmp
fi
# Run the test with 2 core mpi
${MXTEST_EXECUTABLE} --verbose --testdir $PWD --suffix ${{ matrix.os }}_${{ matrix.mpi }} --mpi=${{ matrix.nmpi }} --uid=${RUNNER_TRACKING_ID}
${MXTEST_EXECUTABLE} --verbose --testdir $PWD --suffix ${{ matrix.os }}_${{ matrix.mpi }} --mpi=${{ matrix.nmpi }} --uid=${MYWORKERID}

- name: 'Tar output files'
id: tar-package
Expand Down
Loading