From fb27efa8620959189ae5411d0862b3fabd349633 Mon Sep 17 00:00:00 2001 From: Andrea Valassi Date: Sat, 4 Nov 2023 22:04:38 +0100 Subject: [PATCH] [actions] in .github/workflows/testsuite, do not compare to current repo those processes that are not in the git repo --- .github/workflows/testsuite_oneprocess.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/testsuite_oneprocess.sh b/.github/workflows/testsuite_oneprocess.sh index b9da6033e6..97a679f9c0 100755 --- a/.github/workflows/testsuite_oneprocess.sh +++ b/.github/workflows/testsuite_oneprocess.sh @@ -35,16 +35,20 @@ function codegen() { ./CODEGEN/generateAndCompare.sh -q ${proc%.sa} fi # Check if there are any differences to the current repo - git checkout HEAD ${proc}/CODEGEN*.txt - if [ "${proc%.mad}" != "${proc}" ]; then - git checkout HEAD ${proc}/Cards/me5_configuration.txt - ###sed -i 's/DEFAULT_F2PY_COMPILER=f2py.*/DEFAULT_F2PY_COMPILER=f2py3/' ${proc}/Source/make_opts - git checkout HEAD ${proc}/Source/make_opts + compare=true # enable comparison to current git repo + ###compare=false # disable comparison to current git repo + if [ ${compare} ] && [ "$(git ls-tree --name-only HEAD ${proc})" != "" ]; then + git checkout HEAD ${proc}/CODEGEN*.txt + if [ "${proc%.mad}" != "${proc}" ]; then + git checkout HEAD ${proc}/Cards/me5_configuration.txt + ###sed -i 's/DEFAULT_F2PY_COMPILER=f2py.*/DEFAULT_F2PY_COMPILER=f2py3/' ${proc}/Source/make_opts + git checkout HEAD ${proc}/Source/make_opts + fi + echo + echo "git diff (start)" + git diff --exit-code + echo "git diff (end)" fi - echo - echo "git diff (start)" - git diff --exit-code - echo "git diff (end)" } #----------------------------------------------------------------------------------------------------------------------------------