-
Notifications
You must be signed in to change notification settings - Fork 55
185 lines (180 loc) · 7.28 KB
/
tests_cmake_t8code_linkage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
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.
env:
DEBUG_CONFIG: "-O1"
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)'
TEST_LEVEL:
required: true
type: number
description: 'Test level used for configuring (0 for full tests, 1 for less thorough tests, 2 for minimal tests)'
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: Set test level
if: ${{ inputs.TEST_LEVEL != 0 }}
run: export TEST_LEVEL_FLAG="-DT8CODE_TEST_LEVEL=${{ inputs.TEST_LEVEL }}"
&& echo TEST_LEVEL_FLAG="$TEST_LEVEL_FLAG" >> $GITHUB_ENV
- name: build config variables
run: export CONFIG_OPTIONS="${TEST_LEVEL_FLAG} -GNinja -DCMAKE_C_FLAGS_DEBUG=${DEBUG_CONFIG} -DCMAKE_CXX_FLAGS_DEBUG=${DEBUG_CONFIG} -DT8CODE_USE_SYSTEM_SC=ON -DT8CODE_USE_SYSTEM_P4EST=ON -DT8CODE_BUILD_PEDANTIC=ON -DT8CODE_BUILD_WALL=ON -DT8CODE_BUILD_WERROR=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: serial tests (if MPI is enabled)
run: cd build_netcdf && ctest $MAKEFLAGS -R _serial
if: ${{ inputs.MPI == 'ON' }}
- name: parallel tests (if MPI is enabled)
run: cd build_netcdf && ctest -R _parallel
if: ${{ inputs.MPI == 'ON' }}
- name: tests (if MPI is disabled)
run: cd build_netcdf && ctest $MAKEFLAGS
if: ${{ inputs.MPI == 'OFF' }}
- 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: serial tests (if MPI is enabled)
run: cd build_occ && ctest $MAKEFLAGS -R _serial
if: ${{ inputs.MPI == 'ON' }}
- name: parallel tests (if MPI is enabled)
run: cd build_occ && ctest -R _parallel
if: ${{ inputs.MPI == 'ON' }}
- name: tests (if MPI is disabled)
run: cd build_occ && ctest $MAKEFLAGS
if: ${{ inputs.MPI == 'OFF' }}
- 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: serial tests (if MPI is enabled)
run: cd build_vtk && ctest $MAKEFLAGS -R _serial
if: ${{ inputs.MPI == 'ON' }}
- name: parallel tests (if MPI is enabled)
run: cd build_vtk && ctest -R _parallel
if: ${{ inputs.MPI == 'ON' }}
- name: tests (if MPI is disabled)
run: cd build_vtk && ctest $MAKEFLAGS
if: ${{ inputs.MPI == 'OFF' }}
- 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