From de9877e46231f2ab281ec35828012913e0bbba3b Mon Sep 17 00:00:00 2001 From: Mark Gates Date: Sat, 5 Aug 2023 16:46:09 -0400 Subject: [PATCH] ci: sync; add Intel compiler tests --- .github/workflows/build.sh | 1 + .github/workflows/configure.sh | 19 +++++++++++++------ .github/workflows/main.yml | 8 +++++--- .github/workflows/setup_env.sh | 31 ++++++++++++++++++++++++------- .github/workflows/test.sh | 10 ++++++---- 5 files changed, 49 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.sh b/.github/workflows/build.sh index b09e2f4..1311045 100755 --- a/.github/workflows/build.sh +++ b/.github/workflows/build.sh @@ -1,6 +1,7 @@ #!/bin/bash -x maker=$1 +compiler=$2 mydir=$(dirname $0) source ${mydir}/setup_env.sh diff --git a/.github/workflows/configure.sh b/.github/workflows/configure.sh index 4c59546..becec84 100755 --- a/.github/workflows/configure.sh +++ b/.github/workflows/configure.sh @@ -1,6 +1,7 @@ #!/bin/bash -x maker=$1 +compiler=$2 if [ "${maker}" = "cmake" ]; then rm -rf build @@ -11,18 +12,24 @@ mydir=$(dirname $0) source ${mydir}/setup_env.sh print "======================================== Environment" -env +# Show environment variables, excluding functions. +(set -o posix; set) + +print "======================================== Modules" +quiet module list -l print "======================================== Setup build" -export color=no +# Note: set all env variables in setup_env.sh, +# else build.sh and test.sh won't see them. + rm -rf ${top}/install if [ "${maker}" = "make" ]; then make distclean - make config CXXFLAGS="-Werror" prefix=${top}/install \ + make config prefix=${top}/install \ || exit 10 -fi -if [ "${maker}" = "cmake" ]; then - cmake -Dcolor=no -DCMAKE_CXX_FLAGS="-Werror" \ + +elif [ "${maker}" = "cmake" ]; then + cmake -Dcolor=no \ -DCMAKE_INSTALL_PREFIX=${top}/install \ .. \ || exit 12 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5d5c4da..2d82319 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,16 +16,18 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: icl_testsweeper: + timeout-minutes: 120 strategy: matrix: maker: [make, cmake] + compiler: [gnu, intel] fail-fast: false runs-on: self-hosted steps: - uses: actions/checkout@v3 - name: Configure - run: .github/workflows/configure.sh ${{matrix.maker}} + run: .github/workflows/configure.sh ${{matrix.maker}} ${{matrix.compiler}} - name: Build - run: .github/workflows/build.sh ${{matrix.maker}} + run: .github/workflows/build.sh ${{matrix.maker}} ${{matrix.compiler}} - name: Test - run: .github/workflows/test.sh ${{matrix.maker}} + run: .github/workflows/test.sh ${{matrix.maker}} ${{matrix.compiler}} diff --git a/.github/workflows/setup_env.sh b/.github/workflows/setup_env.sh index e69b7e8..b82abd6 100755 --- a/.github/workflows/setup_env.sh +++ b/.github/workflows/setup_env.sh @@ -32,15 +32,34 @@ export top=$(pwd) shopt -s expand_aliases - -print "======================================== Load compiler" -quiet module load gcc@7.3.0 -quiet which g++ -g++ --version +quiet module load python +quiet which python +quiet which python3 +python --version +python3 --version quiet module load pkgconf quiet which pkg-config +export color=no +export CXXFLAGS="-Werror -Wno-unused-command-line-argument" + +#----------------------------------------------------------------- Compiler +if [ "${compiler}" = "intel" ]; then + print "======================================== Load Intel oneAPI compiler" + quiet module load intel-oneapi-compilers +else + print "======================================== Load GNU compiler" + quiet module load gcc@8.5.0 +fi +print "---------------------------------------- Verify compiler" +print "CXX = $CXX" +print "CC = $CC" +print "FC = $FC" +${CXX} --version +${CC} --version +${FC} --version + if [ "${maker}" = "cmake" ]; then print "======================================== Load cmake" quiet module load cmake @@ -48,5 +67,3 @@ if [ "${maker}" = "cmake" ]; then cmake --version cd build fi - -quiet module list diff --git a/.github/workflows/test.sh b/.github/workflows/test.sh index 9776173..2c157a2 100755 --- a/.github/workflows/test.sh +++ b/.github/workflows/test.sh @@ -1,19 +1,21 @@ #!/bin/bash -x maker=$1 +compiler=$2 mydir=$(dirname $0) source ${mydir}/setup_env.sh -print "======================================== Tests" - # Instead of exiting on the first failed test (bash -e), # run all the tests and accumulate failures into $err. err=0 -cd test export OMP_NUM_THREADS=8 -./run_tests.py --xml ${top}/report-${maker}.xml + +print "======================================== Tests" +cd test + +./run_tests.py (( err += $? )) # todo smoke tests