Skip to content

Commit bef5c1d

Browse files
committed
Manual sync of workflows from main...
1 parent 0be597f commit bef5c1d

File tree

8 files changed

+635
-46
lines changed

8 files changed

+635
-46
lines changed

.github/workflows/mcstas-autobuild.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
set -x
8282
cd McCode
8383
# Check if this is a clear-cut release-tag build:
84-
export REV=`git tag --points-at HEAD`
84+
export REV=`git tag --points-at HEAD | cut -b2-`
8585
# Otherwise, pick latest and add _nightly
8686
if [ "$REV" == "" ]; then export REV=`git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags origin 'v*.*.*' | tail -1 | cut -f3 -d/ | cut -f2 -dv`_nightly; fi
8787
echo Building on $RUNNER_OS with version set to $REV
@@ -97,7 +97,7 @@ jobs:
9797
set -x
9898
cd McCode
9999
# Check if this is a clear-cut release-tag build:
100-
export REV=`git tag --points-at HEAD`
100+
export REV=`git tag --points-at HEAD | cut -b2-`
101101
# Otherwise, pick latest and add _nightly
102102
if [ "$REV" == "" ]; then export REV=`git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags origin 'v*.*.*' | tail -1 | cut -f3 -d/ | cut -f2 -dv`_nightly; fi
103103
echo Building on $RUNNER_OS with version set to $REV
@@ -112,7 +112,7 @@ jobs:
112112
set -x
113113
cd McCode
114114
# Check if this is a clear-cut release-tag build:
115-
export REV=`git tag --points-at HEAD`
115+
export REV=`git tag --points-at HEAD | cut -b2-`
116116
# Otherwise, pick latest and add _nightly
117117
if [ "$REV" == "" ]; then export REV=`git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags origin 'v*.*.*' | tail -1 | cut -f3 -d/ | cut -f2 -dv`_nightly; fi
118118
echo Cross-compiling for MinGW Windows on $RUNNER_OS with version set to $REV

.github/workflows/mcstas-basictest.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,8 @@ jobs:
2020
include:
2121
- { os: ubuntu-24.04, CC: gcc-13, CXX: g++-13, python: '3.12', mpi: 'openmpi' }
2222
- { os: ubuntu-24.04, CC: clang, CXX: clang++, python: '3.12', mpi: 'openmpi' }
23-
- { os: ubuntu-22.04, CC: clang, CXX: clang++, python: '3.11', mpi: 'openmpi' }
24-
- { os: ubuntu-22.04, CC: gcc-12, CXX: g++-12, python: '3.11', mpi: 'openmpi' }
25-
- { os: macos-13, CC: clang, CXX: clang++, python: "3.11", mpi: 'mpich' }
26-
- { os: macos-14, CC: clang, CXX: clang++, python: "3.12", mpi: 'mpich' }
27-
- { os: macos-15, CC: clang, CXX: clang++, python: "3.13", mpi: 'mpich' }
28-
- { os: windows-2022, CC: cl.exe, CXX: cl.exe, python: "3.13", mpi: 'msmpi' }
29-
- { os: windows-2022, CC: gcc.exe, CXX: g++.exe, python: "3.13", mpi: 'msmpi' }
30-
- { os: windows-2025, CC: cl.exe, CXX: cl.exe, python: "3.13", mpi: 'msmpi' }
3123
- { os: windows-11-arm, CC: cl.exe, CXX: cl.exe, python: "3.13", mpi: 'msmpi' }
24+
- { os: windows-latest, CC: gcc.exe, CXX: g++.exe, python: "3.13", mpi: 'msmpi' }
3225

3326
name: ${{ matrix.os }}.${{ matrix.CC }}.${{ matrix.mpi }}.python-${{ matrix.python }}
3427
runs-on: ${{ matrix.os }}
@@ -480,27 +473,33 @@ jobs:
480473
export RUNALL="NO"
481474
if [ "$NUMCHANGEDCOMPS" != "0" ];
482475
then
483-
if [ "$NUMCHANGEDCOMPS" -lt "10" ];
476+
if [ "$NUMCHANGEDCOMPS" -lt "20" ];
484477
then
485478
for comp in $CHANGEDCOMPS;
486479
do
487480
echo Finding instruments matching component $comp
488-
MATCH=`find mcstas-comps -name \*.instr -exec grep -H ${comp} \{\} \; | cut -f1 -d: | sort | uniq | xargs -n1 basename | sed s/\.instr//g | xargs echo`
489-
export COMPILIST=`echo $COMPILIST $MATCH`
481+
NUMMATCH=`find mcstas-comps -name \*.instr -exec grep -H ${comp} \{\} \; | cut -f1 -d: | sort | uniq | wc -l`
482+
if [ "$NUMMATCH" -gt "0" ];
483+
then
484+
MATCH=`find mcstas-comps -name \*.instr -exec grep -H ${comp} \{\} \; | cut -f1 -d: | sort | uniq | xargs -n1 basename | sed s/\.instr//g | xargs echo`
485+
export COMPILIST=`echo $COMPILIST $MATCH`
486+
else
487+
export COMPILIST=`echo $COMPILIST template_simple`
488+
fi
490489
done
491490
else
492491
export RUNALL="YES"
493492
fi
494493
fi
495494
export CHANGEDINSTR=`git diff --name-only HEAD HEAD~1| grep \.instr\$ | grep mcstas-comps | xargs -n1 basename | sed s/\.instr//g | xargs echo`
496-
export CHANGEDINSTR=`echo $CHANGEDINSTR $COMPILIST | sort | uniq | sed s/\ /,/g`
495+
export CHANGEDINSTR=`echo $CHANGEDINSTR $COMPILIST | xargs -n1 echo | sort | uniq | xargs echo | sed s/\ /,/g`
497496
export NUMCHANGEDINSTR=`git diff --name-only HEAD HEAD~1|grep \.instr\$ | grep mcstas-comps | wc -l | xargs echo`
498497
echo ----
499498
echo $NUMCHANGEDCOMPS components and $NUMCHANGEDINSTR instruments were changed, resulting in this list:
500499
echo $CHANGEDINSTR
501500
echo ----
502501
cd -
503-
if [ "$NUMCHANGEDINSTR" -gt "10" ];
502+
if [ "$NUMCHANGEDINSTR" -gt "20" ];
504503
then
505504
export RUNALL="YES"
506505
fi
@@ -518,10 +517,10 @@ jobs:
518517
if [ "$RUNNER_OS" == macOS ]; then
519518
export PERMISSIVE="--permissive"
520519
fi
521-
../install_mcstas/bin/${MCTEST_EXECUTABLE} --testdir $PWD $SCOPE --suffix=CHANGES $PERMISSIVE
520+
../install_mcstas/bin/${MCTEST_EXECUTABLE} --testdir $PWD $SCOPE --suffix=${{ matrix.CC }}_CHANGES $PERMISSIVE
522521
mcviewtest --nobrowse $PWD
523522
else
524-
echo ..\\install\\bin\\mctest --verbose --testdir=. $SCOPE --suffix=CHANGES --permissive > changedinstr.bat
523+
echo ..\\install\\bin\\mctest --verbose --testdir=. $SCOPE --suffix=${{ matrix.CC }}_CHANGES --permissive > changedinstr.bat
525524
fi
526525
fi
527526
@@ -618,6 +617,8 @@ jobs:
618617
set -e
619618
set -u
620619
set -x
620+
# Clear out binaries from sim dir and tar up artifact
621+
ls | grep run_ | xargs -n1 ./src/devel/bin/mccode-simdir-cleanfiles -d
621622
tar cvfz mcstas-${{ matrix.os }}.${{ matrix.CC }}.${{ matrix.mpi }}.python-${{ matrix.python }}_output.tgz run_*
622623
623624
- name: 'Upload Artifact'

0 commit comments

Comments
 (0)