Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TriBITS CI testing with GitHub Actions (#363) #389

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
62cc3ed
#377: - first try with CI
marcinwrobel1986 Jul 15, 2021
42c175a
#377: - added no fortran option
marcinwrobel1986 Jul 15, 2021
ad56911
#377: - run job only when push on master branch
marcinwrobel1986 Jul 15, 2021
2c1af51
#377: - attempt to try different variants
marcinwrobel1986 Jul 16, 2021
15959a7
#377: - added version checking
marcinwrobel1986 Jul 16, 2021
dabbcf8
#377: - try to get specific versions
marcinwrobel1986 Jul 16, 2021
3fabb91
#377: - separate removing and installation
marcinwrobel1986 Jul 16, 2021
3d15fef
#377: - checks for testing purposes
marcinwrobel1986 Jul 16, 2021
02da36a
#377: - removed checks
marcinwrobel1986 Jul 16, 2021
6af8a6a
#377: - created aliases
marcinwrobel1986 Jul 16, 2021
135b19a
#377: - check if aliases work
marcinwrobel1986 Jul 16, 2021
06ba32b
#377: - trying other way
marcinwrobel1986 Jul 16, 2021
6a51fe7
#377: - fixed if
marcinwrobel1986 Jul 16, 2021
adf2d2a
#377: - fixed if
marcinwrobel1986 Jul 16, 2021
7acbfbd
#377: - check for aliases
marcinwrobel1986 Jul 16, 2021
127601f
#377: - try alternatives
marcinwrobel1986 Jul 16, 2021
9a62a04
#377: - try alternatives
marcinwrobel1986 Jul 16, 2021
3e0b5bb
#377: - try alternatives
marcinwrobel1986 Jul 16, 2021
fd4040f
#377: - fix memory problem
marcinwrobel1986 Jul 16, 2021
2a6bd9c
#377: - removed unnecessary options
marcinwrobel1986 Jul 16, 2021
fdaf159
#377: - changing order of the tests
marcinwrobel1986 Jul 16, 2021
9429c53
Add 'generator' option (not used yet)
bartlettroscoe Jul 16, 2021
895d469
Disable submits to CDash
bartlettroscoe Jul 16, 2021
63dc18a
Merge remote-tracking branch 'github/master' into 377-github-actions-ci
bartlettroscoe Jul 19, 2021
2aa9ffb
Add GitHub Actions-specific driver (#363)
bartlettroscoe Jul 19, 2021
5656f5a
Switch over to use run_github_actions_ctest_driver.sh (#363)
bartlettroscoe Jul 19, 2021
a33fc8a
Change max-parallel from 1 to 4 (#363)
bartlettroscoe Jul 19, 2021
8619153
No more hello_world.yml (#363)
bartlettroscoe Jul 19, 2021
fd7e45a
Fix path to run run_github_actions_ctest_driver.sh (#363)
bartlettroscoe Jul 19, 2021
c76f708
Fix misspelling of 'compiler' (#363)
bartlettroscoe Jul 19, 2021
4f57dc6
Property disable set --fortran-compiler-and-ver (#363)
bartlettroscoe Jul 19, 2021
8c5fe4e
Set 'fail-fast' to false (#363)
bartlettroscoe Jul 19, 2021
fa559e3
Allow --fortran-compiler-and-ver with no val, improve cmndline checki…
bartlettroscoe Jul 19, 2021
091a21d
Don't test build of docs for now (#363)
bartlettroscoe Jul 19, 2021
70de392
Rearrange options in matrix to match order in CTEST_BUILD_NAME (#363)
bartlettroscoe Jul 19, 2021
5ff5d9e
Make all builds use makefiles for now (#363)
bartlettroscoe Jul 19, 2021
f72490d
Set TriBITS_SHOW_TEST_START_END_DATE_TIME=ON (#363)
bartlettroscoe Jul 20, 2021
d2ddbaa
Adjust for MixedLang disable with no Fortran (#363)
bartlettroscoe Jul 20, 2021
1f397e0
Disable a bunch of tests that fail if there is no Fortran (#363)
bartlettroscoe Jul 20, 2021
d01b667
Make WORLD_READABLE=TRUE set same perms as GROUP_WRITABLE (#314, #363)
bartlettroscoe Jul 20, 2021
aae3bed
Adjust for different CMake 3.21 error output (#363)
bartlettroscoe Jul 20, 2021
65ee4e6
Adjust for different number of install errors reported by CMake 3.21 …
bartlettroscoe Jul 20, 2021
36af217
Adjust for move of rules.ninja in CMake 3.18 (#363)
bartlettroscoe Jul 20, 2021
3024a80
Update min version of CMake from 2.6 to 2.17 of old Fortran name mana…
bartlettroscoe Jul 20, 2021
87aa1d2
Merge remote-tracking branch 'rab-github/363-fix-ci-tests' into 377-g…
bartlettroscoe Jul 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions .github/workflows/hellow_world.yml

This file was deleted.

75 changes: 75 additions & 0 deletions .github/workflows/tribits_testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: TriBITS Testing

# Controls when the action will run.
# Triggers the workflow on push or pull request
# for the master and develop branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
strategy:
max-parallel: 4 # Only limit to 1 for debugging?
fail-fast: false # Allow each job to run to completion even if other jobs fail first
matrix:
config:
- { os: ubuntu-latest, cmake: "3.17.0", generator: "makefiles", python: "2.7", cc: gcc-8, cxx: g++-8, fc: gfortran-8 }
- { os: ubuntu-latest, cmake: "3.17.0", generator: "makefiles", python: "3.8", cc: gcc-10, cxx: g++-10, fc: gfortran-10 }
- { os: ubuntu-latest, cmake: "3.17.0", generator: "makefiles", python: "3.8", cc: gcc-11, cxx: g++-11 }
- { os: ubuntu-latest, cmake: "3.21.0", generator: "makefiles", python: "3.8", cc: gcc-9, cxx: g++-9, fc: gfortran-9 }

runs-on: ${{ matrix.config.os }}

steps:
- uses: actions/checkout@v2

- name: Update OS
run: |
sudo apt-get update -y
- name: Install CMake
run: |
wget -O cmake.sh https://github.com/Kitware/CMake/releases/download/v${{ matrix.config.cmake }}/cmake-${{ matrix.config.cmake }}-Linux-x86_64.sh
sudo sh cmake.sh --skip-license --exclude-subdir --prefix=/usr/local/
- name: Install packages
run: |
sudo apt-get install -y ${{ matrix.config.cc }} ${{ matrix.config.cxx }} ${{ matrix.config.fc }}
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/${{ matrix.config.cc }} 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/${{ matrix.config.cxx }} 10
sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/${{ matrix.config.fc }} 10
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 20
sudo update-alternatives --set cc /usr/bin/gcc
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 20
sudo update-alternatives --set c++ /usr/bin/g++
sudo update-alternatives --install /usr/bin/fortrann fortrann /usr/bin/gfortran 20
sudo update-alternatives --set fortrann /usr/bin/gfortran
sudo apt-get -y install valgrind
sudo apt-get -y install ninja-build
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.config.python }}
- name: Version checks
run: |
echo "Checking Cmake path and version"
which cmake
cmake --version
echo "Checking gcc path and version"
which ${{ matrix.config.cc }}
${{ matrix.config.cc }} --version
echo "Checking g++ path and version"
which ${{ matrix.config.cxx }}
${{ matrix.config.cxx }} --version
if [ "${{ matrix.config.fc }}" = "" ]; then echo "No fortran compiler"; else echo "Checking gfortran path and version" && which ${{ matrix.config.fc }} && ${{ matrix.config.fc }} --version; fi
- name: Run configure, build, test, and submit to CDash
run: |
cd ..
./TriBITS/cmake/ctest/github_actions/run_github_actions_ctest_driver.sh \
--os ${{ matrix.config.os }} \
--cmake-ver ${{ matrix.config.cmake }} \
--generator ${{ matrix.config.generator }} \
--python-ver ${{ matrix.config.python }} \
--cxx-compiler-and-ver ${{ matrix.config.cxx }} \
--fortran-compiler-and-ver ${{ matrix.config.fc }}
41 changes: 41 additions & 0 deletions cmake/ctest/github_actions/ctest_github_actions_serial_debug.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
include("${CMAKE_CURRENT_LIST_DIR}/../TribitsProjCTestDriver.cmake")

set(CTEST_BUILD_NAME $ENV{CTEST_BUILD_NAME})

set(CTEST_TEST_TIMEOUT 60)
set(CTEST_DO_UPDATES OFF)
set_default_and_from_env(CTEST_BUILD_FLAGS "-j2")
set_default_and_from_env(CTEST_PARALLEL_LEVEL "2")

if (CTEST_BUILD_NAME MATCHES ".*_nofortran")
set(fortranCompilerStr "")
set(enableFortranStr "-DTriBITS_ENABLE_Fortran=OFF")
else()
set(fortranCompilerStr "-DCMAKE_Fortran_COMPILER=gfortran")
set(enableFortranStr "-DTriBITS_ENABLE_Fortran=ON")
endif()

set( EXTRA_CONFIGURE_OPTIONS
"-DBUILD_SHARED_LIBS:BOOL=ON"
"-DCMAKE_BUILD_TYPE=DEBUG"
"-DCMAKE_C_COMPILER=gcc"
"-DCMAKE_CXX_COMPILER=g++"
"${fortranCompilerStr}"
"${enableFortranStr}"
"-DTriBITS_CTEST_DRIVER_COVERAGE_TESTS=TRUE"
"-DTriBITS_CTEST_DRIVER_MEMORY_TESTS=TRUE"
#"-DTriBITS_ENABLE_DOC_GENERATION_TESTS=ON"
"-DTriBITS_ENABLE_REAL_GIT_CLONE_TESTS=TRUE"
"-DTriBITS_TRACE_ADD_TEST=ON"
"-DTriBITS_SHOW_TEST_START_END_DATE_TIME=ON"
)

if ("$ENV{CTEST_TEST_TYPE}" STREQUAL "")
set(CTEST_TEST_TYPE Experimental)
endif()

#
# Run the CTest driver and submit to CDash
#

tribits_proj_ctest_driver()
179 changes: 179 additions & 0 deletions cmake/ctest/github_actions/run_github_actions_ctest_driver.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
#!/bin/bash -e

#
# Run local configure/build/test and submit to CDash with
# tribits_ctest_driver().
#
# Usage:
#
# $ cd <some-base-dir>/
#
# <this-dir>/run_github_actions_ctest_driver.sh \
# --os <os> --cmake-ver <cmake-ver> \
# --generator ninja|makefiles \
# --python-ver <python-ver> \
# --cxx-compiler-and-ver <cxx-compiler-and-ver> \
# [ --fortran-compiler-and-ver <fortran-comiler-and-ver> ]
#
# This is called by the GitHub Actions script:
#
# TriBITS/.github/workflows/tribits_testing.yml
#
# but can also be run locally to develop on and debug.
#
# NOTE: This will create the subdir 'tribits-build' under $PWD if that
# directory does not already exist. But it will not delete an existing
# directly 'tribits-build' if it already exists (but that is usually fine to
# do rebulids).
#
# NOTE: One can control various behaviors and other options as documented with
# tribits_ctest_driver() including not submitting to CDash to do testing
# output spamming CDash by running with:
#
# env CTEST_DO_SUBMIT=OFF <this-dir>/run_github_actions_ctest_driver.sh [options]
#

# Get locaiton of TriBITS
if [ "$TRIBITS_BASE_DIR" == "" ] ; then
_ABS_FILE_PATH=`readlink -f $0`
_BASE_DIR=`dirname $_ABS_FILE_PATH`
TRIBITS_BASE_DIR=`realpath $_BASE_DIR/../../..`
fi


#
# Functions
#


function assert_option_has_value {
value=$1
if [[ ${value:0:1} == "-" ]] ; then
echo "Error, expecting a value, not next option '${value}'" >&2
exit 1
fi
}


function assert_required_option_set {
arg_name=$1
arg_value=$2
#echo "${arg_name} ${arg_value}"
if [[ "${arg_value}" == "" ]] ; then
echo "Error, argument ${arg_name} can not be empty!"
exit 1
fi
}


#
# A) Parse and assert command-line arguments
#

os=
cmake_ver=
cmake_generator=
python_ver=
cxx_compiler_and_ver=
fortran_compiler_and_ver=

while (( "$#" )); do
case "$1" in
--os)
assert_option_has_value $2
os=$2
shift 2
;;
--cmake-ver)
assert_option_has_value $2
cmake_ver=$2
shift 2
;;
--generator)
assert_option_has_value $2
cmake_generator=$2
shift 2
;;
--python-ver)
assert_option_has_value $2
python_ver=$2
shift 2
;;
--cxx-compiler-and-ver)
assert_option_has_value $2
cxx_compiler_and_ver=$2
shift 2
;;
--fortran-compiler-and-ver)
if [[ -n "$2" ]] && [[ ${2:0:1} != "-" ]]; then
fortran_compiler_and_ver=$2
shift 2
else
shift 1
fi
;;
*)
echo "Error: The argument '$1' is not supported!" >&2
exit 1
;;
esac
done

assert_required_option_set --os ${os}
assert_required_option_set --cmake-ver "${cmake_ver}"
assert_required_option_set --generator "${cmake_generator}"
assert_required_option_set --python-ver "${python_ver}"
assert_required_option_set --cxx-compiler-and-ver "${cxx_compiler_and_ver}"
# NOTE: Fortran is not required!

#
# B) Set up options for running build
#

echo
echo "Options to run set in github actions driver:"
echo

# CTEST_SITE
export CTEST_SITE=${os}
echo "CTEST_SITE = '${CTEST_SITE}'"

# CTEST_BUILD_NAME
CTEST_BUILD_NAME=tribits_cmake-${cmake_ver}_${cmake_generator}_python-${python_ver}_${cxx_compiler_and_ver}
if [[ "${fortran_compiler_and_ver}" == "" ]] ; then
CTEST_BUILD_NAME=${CTEST_BUILD_NAME}_nofortran
fi
export CTEST_BUILD_NAME
echo "CTEST_BUILD_NAME = '${CTEST_BUILD_NAME}'"

# CTEST_CMAKE_GENERATOR
if [[ "${cmake_generator}" == "ninja" ]] ; then
CTEST_CMAKE_GENERATOR=Ninja
elif [[ "${cmake_generator}" == "makefiles" ]] ; then
CTEST_CMAKE_GENERATOR="Unix Makefiles"
else
echo "Error, --generator ${cmake_generator} is invalid! Only 'makefiles', 'ninja'!" >&2
exit 1
fi
export CTEST_CMAKE_GENERATOR
echo "CTEST_CMAKE_GENERATOR = '${CTEST_CMAKE_GENERATOR}'"

#
# C) Run the local configure, build, test and submit using exported vars above
#

echo

if [[ -d tribits-build ]] ; then
echo "tribits-build/ already exists so leaving it."
else
echo "tribits-build/ does not exist yet so creating it."
mkdir tribits-build
fi

cd tribits-build/

echo

ctest -V -S \
${TRIBITS_BASE_DIR}/cmake/ctest/github_actions/ctest_github_actions_serial_debug.cmake
3 changes: 2 additions & 1 deletion dev_testing/crf450/mpi-debug/do-configure
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ if [ "$TRIBITS_BASE_DIR" == "" ] ; then
fi

${TRIBITS_BASE_DIR}/dev_testing/generic/do-configure-mpi-debug \
-DDART_TESTING_TIMEOUT=60 \
-DCTEST_PARALLEL_LEVEL=16 \
-DTriBITS_CTEST_DRIVER_COVERAGE_TESTS=TRUE \
-DTriBITS_CTEST_DRIVER_MEMORY_TESTS=TRUE \
Expand All @@ -22,7 +23,7 @@ ${TRIBITS_BASE_DIR}/dev_testing/generic/do-configure-mpi-debug \
-DTribitsExProj_INSTALL_BASE_DIR=/tmp/tribits_install_tests \
-DTribitsExProj_INSTALL_OWNING_GROUP=wg-sems-users-son \
-DTriBITS_ENABLE_REAL_GIT_CLONE_TESTS=ON \
-DDART_TESTING_TIMEOUT=60 \
-DTriBITS_SHOW_TEST_START_END_DATE_TIME=ON \
"$@"

#-DTriBITS_CTEST_DRIVER_COVERAGE_TESTS=TRUE \
Expand Down
Loading