-
Notifications
You must be signed in to change notification settings - Fork 0
227 lines (204 loc) · 8.12 KB
/
reusable_test_split_framework.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: '[Split] Build, install and test Arcane Framework'
on:
workflow_call:
inputs:
image:
description: 'Docker image for the workflow'
type: string
required: true
compilo:
description: 'Compiler (GCC, CLang)'
type: string
required: false
default: 'GCC'
mpi:
description: 'MPI (OpenMPI, MPICH)'
type: string
required: false
default: 'OpenMPI'
with_cuda:
description: 'Compile with CUDA too ?'
type: boolean
required: false
default: false
type_build:
description: 'Type of build (Debug, Check, Release)'
type: string
required: false
default: 'Release'
cmake_additionnal_args:
description: 'Additionnal arguments for configure'
type: string
required: false
default: ''
verbose:
description: 'Add verbose args for make/ninja'
type: boolean
required: false
default: false
with_samples:
description: 'Compile samples too ?'
type: boolean
required: false
default: true
execute_tests:
description: 'Execute tests ?'
type: boolean
required: false
default: true
excluded_tests:
description: 'Regex with exclude tests'
type: string
required: false
default: ''
excluded_tests_with_labels:
description: 'Labels of exclude tests'
type: string
required: false
default: ''
cache_key_prefix:
description: 'Cache key prefix'
type: string
required: false
default: 'split'
env:
# CTest
CT_OPTS: "--timeout 1200 --output-on-failure"
# OpenMPI
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
# To tell OpenMPI we may use more processus than available cores
OMPI_MCA_rmaps_base_oversubscribe : true
jobs:
build-install-test:
name: '[Split] Build, install and test Arcane Framework'
runs-on: ubuntu-latest
container:
image: ${{inputs.image}}
steps:
- name: Define environment paths
shell: bash
run: |
echo "SOURCE_DIR=${GITHUB_WORKSPACE}/framework" >> $GITHUB_ENV
echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV
echo "INSTALL_DIR=${GITHUB_WORKSPACE}/install" >> $GITHUB_ENV
echo "CCACHE_DIR=${GITHUB_WORKSPACE}/ccache" >> $GITHUB_ENV
echo "LOG_DIR=${GITHUB_WORKSPACE}/log" >> $GITHUB_ENV
echo "CT_RESULT_DIR=${GITHUB_WORKSPACE}/test" >> $GITHUB_ENV
- name: Set MPICH as default MPI
if: "${{ inputs.mpi == 'MPICH' }}"
shell: bash
run: |
update-alternatives --set mpirun /usr/bin/mpirun.mpich
update-alternatives --set mpi /usr/bin/mpicc.mpich
update-alternatives --set h5pcc /usr/bin/h5pcc.mpich
update-alternatives --set hdf5.pc /usr/lib/x86_64-linux-gnu/pkgconfig/hdf5-mpich.pc
update-alternatives --set mpi-x86_64-linux-gnu /usr/include/x86_64-linux-gnu/mpich
update-alternatives --set parmetis /usr/local/parmetis_mpich/include/parmetis.h
mpirun --version
- name: Add some args for MPI (Usefull with Ubuntu 22.04 + MPICH + CLang)
shell: bash
run: |
echo "CMAKE_ADD_ARGS=${{ env.CMAKE_ADD_ARGS }} \
-DMPI_SKIP_COMPILER_WRAPPER=TRUE \
-DCMAKE_INCLUDE_PATH=/usr/include/x86_64-linux-gnu/mpi \
-DMPI_C_LIB_NAMES=mpi \
-DMPI_CXX_LIB_NAMES=mpi \
-DMPI_mpi_LIBRARY=/usr/lib/x86_64-linux-gnu/libmpi.so \
-DMPI_backtrace_LIBRARY=/usr/lib/x86_64-linux-gnu/libmpi.so \
" >> $GITHUB_ENV
- name: Get date
shell: bash
run: |
echo "m_date=$(/bin/date -u '+%Y%m%d%H%M%S')" >> $GITHUB_ENV
- name: Get cache for ccache tool
uses: actions/cache@v4
with:
path: ${{env.CCACHE_DIR}}
key: ${{ inputs.cache_key_prefix }}-${{ env.m_date }}-${{ github.run_number }}
restore-keys: ${{ inputs.cache_key_prefix }}-
- name: Checkout framework
uses: actions/checkout@v4
with:
path: ${{ env.SOURCE_DIR }}
submodules: true
- name: Install Arccon
uses: arcaneframework/gh_actions/split/install_arccon@v1.6.0
with:
source_dir: ${{ env.SOURCE_DIR }}/arccon
build_dir: ${{ env.BUILD_DIR }}/arccon
install_dir: ${{ env.INSTALL_DIR }}/arccon
log_dir: ${{ env.LOG_DIR }}/arccon
- name: Install ArcDependencies
uses: arcaneframework/gh_actions/split/install_arcdependencies@v1.6.0
with:
source_dir: ${{ env.SOURCE_DIR }}/dependencies
build_dir: ${{ env.BUILD_DIR }}/dependencies
install_dir: ${{ env.INSTALL_DIR }}/dependencies
log_dir: ${{ env.LOG_DIR }}/dependencies
arccon_install_dir: ${{ env.INSTALL_DIR }}/arccon
- name: Build and install AxlStar
uses: arcaneframework/gh_actions/split/build_install_axlstar@v1.6.0
with:
source_dir: ${{ env.SOURCE_DIR }}/axlstar
build_dir: ${{ env.BUILD_DIR }}/axlstar
install_dir: ${{ env.INSTALL_DIR }}/axlstar
log_dir: ${{ env.LOG_DIR }}/axlstar
arccon_install_dir: ${{ env.INSTALL_DIR }}/arccon
arcdependencies_install_dir: ${{ env.INSTALL_DIR }}/dependencies
- name: Build and install Arccore
uses: arcaneframework/gh_actions/split/build_install_arccore@v1.6.0
with:
source_dir: ${{ env.SOURCE_DIR }}/arccore
build_dir: ${{ env.BUILD_DIR }}/arccore
install_dir: ${{ env.INSTALL_DIR }}/arccore
log_dir: ${{ env.LOG_DIR }}/arccore
arccon_install_dir: ${{ env.INSTALL_DIR }}/arccon
cache_dir: ${{ env.CCACHE_DIR }}
cmake_additionnal_args: '${{ env.CMAKE_ADD_ARGS }} ${{ inputs.cmake_additionnal_args }}'
verbose: ${{ inputs.verbose }}
type_build: ${{ inputs.type_build }}
compilo: ${{ inputs.compilo }}
- name: Build and install Arcane
uses: arcaneframework/gh_actions/split/build_install_arcane@v1.6.0
with:
source_dir: ${{ env.SOURCE_DIR }}/arcane
build_dir: ${{ env.BUILD_DIR }}/arcane
install_dir: ${{ env.INSTALL_DIR }}/arcane
log_dir: ${{ env.LOG_DIR }}/arcane
arccon_install_dir: ${{ env.INSTALL_DIR }}/arccon
arcdependencies_install_dir: ${{ env.INSTALL_DIR }}/dependencies
axlstar_install_dir: ${{ env.INSTALL_DIR }}/axlstar
arccore_install_dir: ${{ env.INSTALL_DIR }}/arccore
cache_dir: ${{ env.CCACHE_DIR }}
cmake_additionnal_args: '${{ env.CMAKE_ADD_ARGS }} ${{ inputs.cmake_additionnal_args }}'
verbose: ${{ inputs.verbose }}
type_build: ${{ inputs.type_build }}
compilo: ${{ inputs.compilo }}
with_cuda: ${{ inputs.with_cuda }}
with_samples: ${{ inputs.with_samples }}
- name: Upload failure artifact
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.cache_key_prefix }}-failure_config_build-artifact
path: ${{ env.LOG_DIR }}
retention-days: 7
- name: Test Arccore
if: ${{ inputs.execute_tests }}
shell: bash
run: |
mkdir -p ${{ env.CT_RESULT_DIR }}
ARCANE_CHECK=1 ctest --test-dir ${{ env.BUILD_DIR }}/arccore --output-junit ${{ env.CT_RESULT_DIR }}/results_arccore.xml ${{ env.CT_OPTS }} -E '${{inputs.excluded_tests}}' -LE '${{inputs.excluded_tests_with_labels}}'
- name: Test Arcane
if: ${{ inputs.execute_tests }}
shell: bash
run: |
ARCANE_CHECK=1 ctest --test-dir ${{ env.BUILD_DIR }}/arcane --output-junit ${{ env.CT_RESULT_DIR }}/results_arcane.xml ${{ env.CT_OPTS }} -E '${{inputs.excluded_tests}}' -LE '${{inputs.excluded_tests_with_labels}}'
- name: Upload test artifact
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ inputs.cache_key_prefix }}-test-artifact
path: ${{ env.CT_RESULT_DIR }}
retention-days: 7