TriBITS Testing #1353
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: TriBITS Testing | |
on: | |
schedule: | |
- cron: '10 6 * * *' # Run 10 minutes after 2 AM EDT (6:10 UTC) | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
inputs: | |
ctest_build_name_suffix: | |
description: 'Add a suffix to build names on CDash' | |
required: false | |
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.23.1", generator: "makefiles", python: "3.8", cc: gcc-9, cxx: g++-9, fc: gfortran-9 } | |
- { os: ubuntu-latest, cmake: "3.24.3", generator: "makefiles", python: "3.8", cc: gcc-10, cxx: g++-10 } | |
- { os: ubuntu-latest, cmake: "3.24.3", generator: "makefiles", python: "3.8", cc: gcc-11, cxx: g++-11, fc: gfortran-11, no_have_ninja: no-ninja } | |
- { os: ubuntu-latest, cmake: "3.25.2", generator: "makefiles", python: "3.8", cc: gcc-11, cxx: g++-11, fc: gfortran-11 } | |
runs-on: ${{ matrix.config.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Print GitHub Actions Environment Variables | |
run: | | |
set | grep "^GITHUB_" | |
- 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 | |
if [[ "${{ matrix.config.no_have_ninja }}" != "no-ninja" ]] ; then sudo apt-get -y install ninja-build ; fi | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.config.python }} | |
- name: Install Python packages | |
run: | | |
pip3 install sphinx sphinx-rtd-theme # For testing doc build | |
- name: Version checks | |
run: | | |
echo "Checking cmake path and version" | |
which cmake | |
cmake --version | |
if [[ "${{ matrix.config.no_have_ninja }}" != "no-ninja" ]] ; then echo "Checking ninja path and version" ; which ninja ; ninja --version ; fi | |
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: Fetch repo tags | |
run: | | |
echo "Running: git fetch origin 'refs/tags/*:refs/tags/*'" | |
git fetch origin 'refs/tags/*:refs/tags/*' | |
echo "Running: git tag" | |
git tag | |
- name: Run configure, build, test, and submit to CDash | |
run: | | |
cd .. | |
env CTEST_BUILD_NAME_SUFFIX=${{ github.event.inputs.ctest_build_name_suffix }} \ | |
TRIBITS_ADD_LD_LIBRARY_PATH_HACK_FOR_SIMPLETPL=ON \ | |
./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 }} \ | |
--no-have-ninja ${{ matrix.config.no_have_ninja }} \ | |
--github-repo-match-to-submit TriBITSPub/TriBITS | |
- name: URL to results on CDash | |
run: | | |
cd .. | |
echo "See results posted on CDash:" | |
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" | |
echo | |
cat tribits-build/BUILD/CDashResults.txt | |
echo | |
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" |