Skip to content

Commit

Permalink
[actions] first successful basic integration of one tput test (missin…
Browse files Browse the repository at this point in the history
…g: cache ccache, build all processes, etc)
  • Loading branch information
valassi committed Oct 30, 2023
1 parent fbb4732 commit 2969ad8
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 33 deletions.
109 changes: 79 additions & 30 deletions .github/workflows/manual.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,29 @@
# Automatic exit on error
set -e

# Usage
function usage() {
echo "Usage: $(basename $0) codegen|tput"
exit 1
}

# Check input arguments
if [ "$1" == "codegen" ]; then
stage=$1
shift
elif [ "$1" == "tput" ]; then
stage=$1
shift
else
usage
fi

# Exit status
status=0

# Initialise
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
echo "[manual.sh] starting at $(date)"
echo "[manual.sh] $stage starting at $(date)"
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"

echo
Expand All @@ -34,40 +51,72 @@ topdir=$(pwd)
#echo "Contents of MG5aMC/mg5amcnlo (end)"

# Code generation
cd ${topdir}/epochX/cudacpp
processes="$(git ls-tree --name-only HEAD *.mad *.sa)"
###processes="gg_tt.mad"
for proc in $processes; do
echo
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
echo "Code generation for ${proc}"
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
if [ "${proc%.mad}" != "${proc}" ]; then
# Generate code and check clang formatting
./CODEGEN/generateAndCompare.sh -q ${proc%.mad} --mad
elif [ "${proc%.sa}" != "${proc}" ]; then
# Generate code and check clang formatting
./CODEGEN/generateAndCompare.sh -q ${proc%.sa}
else
echo "WARNING! SKIP process directory '${proc}' because it does not end in .mad or .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
fi
if [ "$stage" == "codegen" ]; then
cd ${topdir}/epochX/cudacpp
###processes="$(git ls-tree --name-only HEAD *.mad *.sa)"
processes="gg_tt.mad" # FOR QUICK TESTS
for proc in $processes; do
echo
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
echo "Code generation for ${proc}"
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
if [ "${proc%.mad}" != "${proc}" ]; then
# Generate code and check clang formatting
./CODEGEN/generateAndCompare.sh -q ${proc%.mad} --mad
elif [ "${proc%.sa}" != "${proc}" ]; then
# Generate code and check clang formatting
./CODEGEN/generateAndCompare.sh -q ${proc%.sa}
else
echo "WARNING! SKIP process directory '${proc}' because it does not end in .mad or .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
fi
echo
echo "git diff (start)"
git diff --exit-code
echo "git diff (end)"
done
fi

# Tput tests (build, runTest.exe, check.exe, gcheck.exe)
if [ "$stage" == "tput" ]; then
cd ${topdir}/epochX/cudacpp
# Install ccache
echo
echo "git diff (start)"
git diff --exit-code
echo "git diff (end)"
done
echo "wget -q https://github.com/ccache/ccache/releases/download/v4.8.3/ccache-4.8.3-linux-x86_64.tar.xz"
wget -q https://github.com/ccache/ccache/releases/download/v4.8.3/ccache-4.8.3-linux-x86_64.tar.xz
echo
echo "tar -xvf ccache-4.8.3-linux-x86_64.tar.xz"
tar -xvf ccache-4.8.3-linux-x86_64.tar.xz
export PATH=$(pwd)/ccache-4.8.3-linux-x86_64:$PATH
# Configure ccache
mkdir $(pwd)/CCACHE_DIR
export CCACHE_DIR=$(pwd)/CCACHE_DIR
echo
echo "ccache --version | head -1"
ccache --version | head -1
echo
echo "ccache -s"
ccache -s
# Configure CXX
echo
echo "g++ --version"
g++ --version
export CXX=g++
# Build and test
echo "./tput/teeThroughputX.sh -makej -ggtt -makeclean"
./tput/teeThroughputX.sh -makej -ggtt -makeclean
fi

# Finalise
echo
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
if [ $status -eq 0 ]; then
if [ $status -eq 0 ]; then # keep this just in case, but 'set -e' causes immediate exit on any error
echo "[manual.sh] $stage finished with status=$status (OK) at $(date)"
else
echo "[manual.sh] $stage finished with status=$status (NOT OK) at $(date)"
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
# type: string

jobs:
codegen:
manualtestsuite:
runs-on: ubuntu-latest
steps:
# See https://github.com/actions/checkout
Expand All @@ -27,7 +27,9 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: codegen_step
run: echo Current directory is $(pwd); echo execute .github/workflows/manual.sh; .github/workflows/manual.sh
#- name: codegen_step
# run: .github/workflows/manual.sh codegen
- name: tput_step
run: .github/workflows/manual.sh tput
#- name: Send greeting
# run: echo "Hello ${{ inputs.name }}"

0 comments on commit 2969ad8

Please sign in to comment.