-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add CI test for t8code with shipped submodules
- Loading branch information
1 parent
3e42eea
commit bd08533
Showing
2 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
109 changes: 109 additions & 0 deletions
109
.github/workflows/tests_cmake_t8code_w_shipped_submodules.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: CMake tests t8code with shipped submodules | ||
|
||
|
||
# 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: 30 | ||
runs-on: ubuntu-latest | ||
container: dlramr/t8code-ubuntu:t8-dependencies | ||
steps: | ||
# | ||
# Setup | ||
# | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- 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: init submodules | ||
run: git submodule init | ||
- name: update submodules | ||
run: git submodule update | ||
- name: Get input vars | ||
run: export MAKEFLAGS="${{ inputs.MAKEFLAGS }}" | ||
&& export MPI="${{ inputs.MPI }}" | ||
&& export BUILD_TYPE="${{ inputs.BUILD_TYPE }}" | ||
&& echo MAKEFLAGS="$MAKEFLAGS" >> $GITHUB_ENV | ||
&& echo MPI="$MPI" >> $GITHUB_ENV | ||
&& echo BUILD_TYPE="$BUILD_TYPE" >> $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_BUILD_PEDANTIC=ON -DT8CODE_ENABLE_MPI=$MPI -DCMAKE_BUILD_TYPE=$BUILD_TYPE" | ||
&& echo CONFIG_OPTIONS="$CONFIG_OPTIONS" >> $GITHUB_ENV | ||
# cmake and test | ||
- name: Printing MPI compiler info | ||
run: mpicc --version && mpirun --version | ||
- name: Printing GCC compiler info | ||
run: gcc --version && g++ --version | ||
- name: echo cmake line | ||
run: echo cmake ../ $CONFIG_OPTIONS | ||
- name: cmake | ||
run: mkdir build && cd build && cmake ../ $CONFIG_OPTIONS | ||
- name: OnFailUploadLog | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: cmake_w_submodules_${{ inputs.BUILD_TYPE }}_MPI_${{ inputs.MPI }}.log | ||
path: build/CMakeFiles/CMakeOutput.log | ||
- name: ninja | ||
run: cd build && ninja $MAKEFLAGS | ||
- name: ninja install | ||
run: cd build && ninja install $MAKEFLAGS | ||
- name: ctest | ||
run: cd build && ctest $MAKEFLAGS | ||
- name: OnFailUploadLog | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-suite_w_submodules_${{ inputs.BUILD_TYPE }}_MPI_${{ inputs.MPI }}.log | ||
path: build/Testing/Temporary/LastTest.log |
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