Skip to content

Commit

Permalink
Merge pull request #1200 from DLR-AMR/feature-CMake_CI_2
Browse files Browse the repository at this point in the history
CMake CI [2/2]
  • Loading branch information
Davknapp authored Aug 23, 2024
2 parents 55d7e45 + f4e036c commit 3e42eea
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 1 deletion.
161 changes: 161 additions & 0 deletions .github/workflows/tests_cmake_t8code_linkage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
name: CMake tests t8code linkage


# This file is part of t8code.
# t8code is a C library to manage a collection (a forest) of multiple
# connected adaptive space-trees of general element types in parallel.
#
# Copyright (C) 2024 the developers
#
# t8code is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# t8code is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with t8code; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

on:
workflow_call:
inputs:
MAKEFLAGS:
required: true
type: string
description: 'Make flags to use for compilation (like -j4)'
MPI:
required: true
type: string
description: 'Use MPI for compilation (ON/OFF)'
BUILD_TYPE:
required: true
type: string
description: 'Build type (Release/Debug)'
LESS_TESTS:
required: true
type: boolean
description: 'Enable less tests option for configuring'

jobs:
t8code_cmake_tests:
timeout-minutes: 60
runs-on: ubuntu-latest
container: dlramr/t8code-ubuntu:t8-dependencies
steps:
#
# Setup
#
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: SC_P4EST_MPI_${{ inputs.MPI }}
- name: untar artifact
run: tar -xf artifact.tar && rm artifact.tar
- name: Update packages
run: apt-get update && apt-get upgrade -y
# This seems to be necessary because of the docker container
- name: disable ownership checks
run: git config --global --add safe.directory '*'
- name: Get input vars
run: export MAKEFLAGS="${{ inputs.MAKEFLAGS }}"
&& export MPI="${{ inputs.MPI }}"
&& export BUILD_TYPE="${{ inputs.BUILD_TYPE }}"
&& export SC_PATH=$PWD/sc/build/$BUILD_TYPE
&& export P4EST_PATH=$PWD/p4est/build/$BUILD_TYPE
&& echo MAKEFLAGS="$MAKEFLAGS" >> $GITHUB_ENV
&& echo MPI="$MPI" >> $GITHUB_ENV
&& echo BUILD_TYPE="$BUILD_TYPE" >> $GITHUB_ENV
&& echo SC_PATH="$SC_PATH" >> $GITHUB_ENV
&& echo P4EST_PATH="$P4EST_PATH" >> $GITHUB_ENV
#
# T8CODE
#
#
# build config vars
- name: less-test option
if: ${{ inputs.LESS_TESTS }}
run: export LESS_TEST_OPTION="-DT8CODE_ENABLE_LESS_TESTS=ON"
&& echo LESS_TEST_OPTION="$LESS_TEST_OPTION" >> $GITHUB_ENV
- name: build config variables
run: export CONFIG_OPTIONS="${LESS_TEST_OPTION} -GNinja -DT8CODE_USE_SYSTEM_SC=ON -DT8CODE_USE_SYSTEM_P4EST=ON -DT8CODE_BUILD_PEDANTIC=ON -DT8CODE_ENABLE_MPI=$MPI -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSC_DIR=$SC_PATH/install/cmake -DP4EST_DIR=$P4EST_PATH/install/cmake"
&& echo CONFIG_OPTIONS="$CONFIG_OPTIONS" >> $GITHUB_ENV
# cmake and test with netcdf
- name: check NetCDF
run: echo "Checking NetCDF"
- name: echo cmake line
run: echo cmake ../ $CONFIG_OPTIONS -DT8CODE_ENABLE_NETCDF=ON
- name: cmake MPI NetCDF debug
run: mkdir build_netcdf && cd build_netcdf && cmake ../ $CONFIG_OPTIONS -DT8CODE_ENABLE_NETCDF=ON
- name: OnFailUploadLog
if: failure()
uses: actions/upload-artifact@v4
with:
name: cmake_${{ inputs.BUILD_TYPE }}_MPI_${{ inputs.MPI }}_NetCDF.log
path: build_netcdf/CMakeFiles/CMakeOutput.log
- name: make
run: cd build_netcdf && ninja $MAKEFLAGS
- name: ninja install
run: cd build_netcdf && ninja install $MAKEFLAGS
- name: ninja test
run: cd build_netcdf && ninja test $MAKEFLAGS
- name: OnFailUploadLog
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-suite_${{ inputs.BUILD_TYPE }}_MPI_${{ inputs.MPI }}_NetCDF.log
path: build_netcdf/Testing/Temporary/LastTest.log
# cmake and test with OpenCASCADE
- name: check OpenCASCADE
run: echo "Checking OpenCASCADE"
- name: echo cmake line
run: echo cmake ../ $CONFIG_OPTIONS -DT8CODE_ENABLE_OCC=ON
- name: cmake OpenCASCADE
run: mkdir build_occ && cd build_occ && cmake ../ $CONFIG_OPTIONS -DT8CODE_ENABLE_OCC=ON
- name: OnFailUploadLog
if: failure()
uses: actions/upload-artifact@v4
with:
name: cmake_${{ inputs.BUILD_TYPE }}_MPI_${{ inputs.MPI }}_OCC.log
path: build_occ/CMakeFiles/CMakeOutput.log
- name: make
run: cd build_occ && ninja $MAKEFLAGS
- name: ninja install
run: cd build_occ && ninja install $MAKEFLAGS
- name: ninja test
run: cd build_occ && ninja test $MAKEFLAGS
- name: OnFailUploadLog
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-suite_${{ inputs.BUILD_TYPE }}_MPI_${{ inputs.MPI }}_OCC.log
path: build_occ/Testing/Temporary/LastTest.log
# cmake and test with VTK
- name: check VTK
run: echo "Checking VTK"
- name: echo cmake line
run: echo cmake ../ $CONFIG_OPTIONS -DT8CODE_ENABLE_VTK=ON -DVTK_DIR=/usr/local/lib/cmake/vtk-9.1
- name: cmake MPI VTK debug
run: mkdir build_vtk && cd build_vtk && cmake ../ $CONFIG_OPTIONS -DT8CODE_ENABLE_VTK=ON -DVTK_DIR=/usr/local/lib/cmake/vtk-9.1
- name: OnFailUploadLog
if: failure()
uses: actions/upload-artifact@v4
with:
name: cmake_${{ inputs.BUILD_TYPE }}_MPI_${{ inputs.MPI }}_VTK.log
path: build_vtk/CMakeFiles/CMakeOutput.log
- name: make
run: cd build_vtk && ninja $MAKEFLAGS
- name: ninja install
run: cd build_vtk && ninja install $MAKEFLAGS
- name: ninja test
run: cd build_vtk && ninja test $MAKEFLAGS
- name: OnFailUploadLog
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-suite_${{ inputs.BUILD_TYPE }}_MPI_${{ inputs.MPI }}_VTK.log
path: build_vtk/Testing/Temporary/LastTest.log
19 changes: 19 additions & 0 deletions .github/workflows/tests_cmake_testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,22 @@ jobs:
BUILD_TYPE: ${{ matrix.BUILD_TYPE }}
LESS_TESTS: ${{ github.event_name == 'pull_request' }}


# Run t8code linkage tests with and without MPI and in serial and debug mode
t8code_linkage_tests:
if: (github.event_name == 'schedule' && github.repository == 'DLR-AMR/t8code') || (github.event_name != 'schedule')
uses: ./.github/workflows/tests_cmake_t8code_linkage.yml
strategy:
fail-fast: false
matrix:
MPI: [OFF, ON]
BUILD_TYPE: [Debug, Release]
include:
- MAKEFLAGS: -j4
needs: preparation
with:
MAKEFLAGS: ${{ matrix.MAKEFLAGS }}
MPI: ${{ matrix.MPI }}
BUILD_TYPE: ${{ matrix.BUILD_TYPE }}
LESS_TESTS: ${{ github.event_name == 'pull_request' }}

1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ if( T8CODE_ENABLE_NETCDF )
endif (netCDF_FOUND)
endif( T8CODE_ENABLE_NETCDF )


# Override default for this libsc option
set( BUILD_SHARED_LIBS ON CACHE BOOL "Build libsc as a shared library" )

Expand Down

0 comments on commit 3e42eea

Please sign in to comment.