-
Notifications
You must be signed in to change notification settings - Fork 14
197 lines (173 loc) · 6.05 KB
/
codecov.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
name: Codecov Scan
on:
schedule:
- cron: '24 0 * * *'
pull_request:
branches: [ main, dev/cea ]
paths-ignore:
- '**.css'
- '**.dox'
- '**.doxyfile'
- '**.geo'
- '**.goto'
- '**.html'
- '**.jpg'
- '**.js'
- '**.markdown'
- '**.md'
- '**.odg'
- '**.old'
- '**.png'
- '**.py'
- '**.samples'
- '**.svg'
- '**.webp'
- '**.yml'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
env:
# CTest
CT_OPTS: "-j4 --timeout 600 --output-on-failure"
EXCLUDED_TESTS: '^.*(mumps).*$'
EXCLUDED_TESTS_WITH_LABELS: 'LARGE_HYBRID'
# OpenMPI
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMPI_MCA_rmaps_base_oversubscribe : true
# Remove test output file after run to reduce disk usage
ARCANE_TEST_CLEANUP_AFTER_RUN: 1
jobs:
build:
name: Codecov
runs-on: ubuntu-latest
container:
image: ghcr.io/arcaneframework/ubuntu-2404:gcc-13_full_20240717
steps:
- name: Display CPU infos
shell: bash
run: |
cat /proc/cpuinfo
- name: Display disks infos
shell: bash
run: |
df -h
# On place la source à la racine pour éviter
# un sous-répertoire en plus dans Codecov.
- name: Define environment paths
shell: bash
run: |
echo "SOURCE_DIR=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> $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 C++ compiler and default MPI
shell: bash
run: |
source /root/scripts/use_openmpi.sh
source /root/scripts/use_gcc-13.sh
- name: Get date
shell: bash
run: echo "m_date=$(/bin/date -u '+%Y%m%d%H%M%S')" >> $GITHUB_ENV
- name: Checkout framework
uses: actions/checkout@v4
with:
path: ${{ env.SOURCE_DIR }}
submodules: true
- name: Get cache for ccache tool
uses: actions/cache@v4
with:
path: ${{env.CCACHE_DIR}}
key: codecov-${{ env.m_date }}-${{ github.run_number }}
restore-keys: codecov-
- name: Build framework
uses: arcaneframework/gh_actions/build_install_framework@v2
with:
source_dir: ${{ env.SOURCE_DIR }}
build_dir: ${{ env.BUILD_DIR }}
log_dir: ${{ env.LOG_DIR }}
cache_dir: ${{ env.CCACHE_DIR }}
max_size_cache_dir: 1G
ccache_debug_mode: false
cmake_additionnal_args: '-DCMAKE_CXX_FLAGS_RELEASE="-O2 -g"
-DARCCORE_CXX_STANDARD=20
-DARCCORE_ENABLE_CODE_COVERAGE=ON
-DARCANE_ENABLE_DOTNET_PYTHON_WRAPPER=ON
-DARCANE_DISABLE_PERFCOUNTER_TESTS=ON
-DARCANE_DISABLE_HYODA=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_Trilinos=ON
-DARCANE_USE_HASHTABLEMAP2_FOR_ITEMINTERNALMAP=ON
-DALIEN_BUILD_COMPONENT=all
-DALIEN_PLUGIN_HYPRE=ON
-DALIEN_PLUGIN_PETSC=ON
-DGFORTRAN_LIBRARY=/usr/lib/gcc/x86_64-linux-gnu/13/libgfortran.so'
type_build: 'Release'
compilo: 'gcc'
verbose: true
with_cuda: false
with_samples: false
- name: Upload failure artifact
if: failure()
uses: actions/upload-artifact@v4
with:
name: codecov-failure_config_build-artifact
path: ${{ env.LOG_DIR }}
retention-days: 7
- name: Display disks infos
shell: bash
run: |
df -h
- name: Test
shell: bash
run: |
mkdir -p ${{ env.CT_RESULT_DIR }}
ARCANE_CHECK=1 ctest --test-dir ${{ env.BUILD_DIR }} --output-junit ${{ env.CT_RESULT_DIR }}/results.xml ${{ env.CT_OPTS }} -E '${{ env.EXCLUDED_TESTS }}' -LE '${{ env.EXCLUDED_TESTS_WITH_LABELS }}'
# https://www.ibm.com/docs/en/developer-for-zos/9.1.1?topic=formats-junit-xml-format
- name: Edit results.xml for Codecov (need valid JUnit XML)
shell: bash
run: |
RESULT_ORI=${{ env.CT_RESULT_DIR }}/results.xml
RESULT_TMP=${{ env.CT_RESULT_DIR }}/results_ori.xml
mv $RESULT_ORI $RESULT_TMP
sed -e '/<testcase.*>/,/<\/testcase>/d' -e 's:</testsuite>::' -e 's/(empty)/CTest Arcane/' -e 's/hostname=""/hostname="GHA"/' $RESULT_TMP > $RESULT_ORI
sed -n '/<testcase.*status="fail">/,/<\/testcase>/p' $RESULT_TMP | sed -e 's:<failure message="".*/>::M' -e 's/<system-out>/<failure message="Logs Arcane:">\n/M' -e 's:</system-out>:</failure>:M' >> $RESULT_ORI
sed -n '/<testcase.*status="run">/,/<\/testcase>/p' $RESULT_TMP >> $RESULT_ORI
echo '</testsuite>' >> $RESULT_ORI
rm $RESULT_TMP
- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
verbose: true
fail_ci_if_error: true
file: ${{ env.CT_RESULT_DIR }}/results.xml
- name: Display disks infos
shell: bash
run: |
df -h
- name: Apply coverage
shell: bash
continue-on-error: true
run: |
gcov -p $(find . -name "*.gcno" -o -name "*.gcda")
- name: Remove gcov files for generated axl .h and generated wrap files
shell: bash
run: |
rm -v -f *_axl.h.gcov *_wrap.*.gcov
- name: Upload coverage files to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
with:
verbose: true
fail_ci_if_error: true
- name: Upload test artifact
uses: actions/upload-artifact@v4
if: failure()
with:
name: codecov-test-artifact
path: ${{ env.CT_RESULT_DIR }}
retention-days: 7