This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
185 lines (172 loc) · 7.97 KB
/
cmake.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
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
workflow_dispatch:
env:
CCACHE_BASEDIR: ${{github.workspace}}
CCACHE_DIR: /tmp/ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: 400M
BUILD_DIR: /tmp/build
INSTALL_DIR: /tmp/install
SPACK_USER_CONFIG_PATH: /tmp/fake-home
SPACK_USER_CACHE_PATH: /tmp/fake-home
SPACK_ENV_FILE: /tmp/spack-env
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
name: ${{matrix.config.name}}
runs-on: ubuntu-latest
container:
image: ${{matrix.config.container}}
options: --user root # Avoid to match github UID in container.
strategy:
fail-fast: false
matrix:
config:
- {
name: "ubuntu20.04 release",
container: "ghcr.io/arcaneframework/alien-ci-ubuntu20.04:main",
precommand: "",
build_type: "RelWithDebInfo",
build_options: "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G Ninja",
alien_options: "-DALIENDEV_EMBEDDED:BOOL=ON -DALIEN_DEFAULT_OPTIONS:BOOL=ON -DALIEN_PLUGIN_GINKGO:BOOL=ON -DALIEN_PLUGIN_GINKGO_OMP:BOOL=ON",
isspack: false
}
- {
name: "ubuntu22.04 release",
container: "ghcr.io/arcaneframework/alien-ci-ubuntu22.04:main",
precommand: "",
build_type: "RelWithDebInfo",
build_options: "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G Ninja",
alien_options: "-DALIENDEV_EMBEDDED:BOOL=ON -DALIEN_DEFAULT_OPTIONS:BOOL=ON -DALIEN_PLUGIN_GINKGO:BOOL=ON -DALIEN_PLUGIN_GINKGO_OMP:BOOL=ON -DALIEN_PLUGIN_TRILINOS:BOOL=ON -DALIEN_PLUGIN_TRILINOS_SERIAL:BOOL=ON",
isspack: false
}
- {
name: "ubuntu20.04 debug",
container: "ghcr.io/arcaneframework/alien-ci-ubuntu20.04:main",
precommand: "",
build_type: "Debug",
build_options: "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G Ninja -DENABLE_SANITIZER_ADDRESS:BOOL=ON -DENABLE_SANITIZER_UNDEFINED_BEHAVIOR:BOOL=ON",
alien_options: "-DALIENDEV_EMBEDDED:BOOL=ON -DALIEN_DEFAULT_OPTIONS:BOOL=ON -DALIEN_PLUGIN_GINKGO:BOOL=ON -DALIEN_PLUGIN_GINKGO_OMP:BOOL=ON",
isspack: false
}
- {
name: "ubuntu20.04 debug memory",
container: "ghcr.io/arcaneframework/alien-ci-ubuntu20.04:main",
precommand: "",
build_type: "Debug",
build_options: "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G Ninja -DENABLE_SANITIZER_MEMORY:BOOL=ON",
alien_options: "-DALIENDEV_EMBEDDED:BOOL=ON -DALIEN_DEFAULT_OPTIONS:BOOL=ON -DALIEN_PLUGIN_GINKGO:BOOL=ON -DALIEN_PLUGIN_GINKGO_OMP:BOOL=ON",
isspack: false
}
- {
name: "ubuntu20.04 debug minimal",
container: "ghcr.io/arcaneframework/alien-ci-ubuntu20.04:main",
precommand: "",
build_type: "Debug",
build_options: "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G Ninja",
alien_options: "-DALIENDEV_EMBEDDED:BOOL=ON -DALIEN_DEFAULT_OPTIONS:BOOL=OFF -DALIEN_PLUGIN_GINKGO:BOOL=ON -DALIEN_PLUGIN_GINKGO_OMP:BOOL=ON",
isspack: false
}
- {
name: "centos7 gimkl 2018b release",
container: " ghcr.io/arcaneframework/centos-gimkl-2018b-alienlegacy:7-latest",
precommand: ". /env.sh",
build_type: "RelWithDebInfo",
build_options: "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_FLAGS='-L${EBROOTLIBXML2} -lxml2'",
alien_options: "-DALIENDEV_EMBEDDED:BOOL=ON -DALIEN_DEFAULT_OPTIONS:BOOL=ON -DVerbose=ON -DBoost_NO_BOOST_CMAKE=ON -DBUILD_SHARED_LIBS=ON -DALIEN_USE_HDF5=ON",
isspack: false
}
- {
name: "rocky8 gimkl 2018b release",
container: "ghcr.io/arcaneframework/rockylinux-gimkl-2018b-alienlegacy:8-latest",
precommand: ". /env.sh",
build_type: "RelWithDebInfo",
build_options: "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_FLAGS='-L${EBROOTLIBXML2} -lxml2'",
alien_options: "-DALIENDEV_EMBEDDED:BOOL=ON -DALIEN_DEFAULT_OPTIONS:BOOL=ON -DVerbose=ON -DBoost_NO_BOOST_CMAKE=ON -DBUILD_SHARED_LIBS=ON -DALIEN_USE_HDF5=ON",
isspack: false
}
- {
name: "rhel8 spack release",
container: "ghcr.io/arcaneframework/arcane-spack-rhel8:main",
precommand: "source .devcontainer/use_spack.sh /tmp/spack-env",
build_type: "RelWithDebInfo",
build_options: "",
alien_options: "-DALIEN_DEFAULT_OPTIONS:BOOL=ON",
isspack: true
}
steps:
# Checkout v2 does not include files listed in .gitattributes
- uses: actions/checkout@v3
# Setting up ccache from github cached files
- name: Prepare ccache timestamp
id: ccache_timestamp
# Disabled for `act`
if: ${{ !env.ACT }}
run: echo "::set-output name=timestamp::$(date +'%Y-%m-%d-%H;%M;%S')"
- name: ccache files
uses: actions/cache@v3
# Disabled for `act`
if: ${{ !env.ACT }}
with:
path: ${{env.CCACHE_DIR}}
key: alien-ccache-${{matrix.config.name}}-${{ steps.ccache_timestamp.outputs.timestamp }}
restore-keys: |
alien-ccache-${{matrix.config.name}}
# setting up spack build env
- name: Setup spack build env
shell: bash
if: matrix.config.isspack
run: |
bash .devcontainer/use_spack.sh ${{env.SPACK_ENV_FILE}}
- name: Configure CMake
shell: bash
# Configure CMake in a 'build' subdirectory. `C MAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: |
${{matrix.config.precommand}}
cmake -B ${{env.BUILD_DIR}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} -DALIEN_PLUGIN_HYPRE:BOOL=ON -DALIEN_PLUGIN_PETSC:BOOL=ON ${{matrix.config.alien_options}} -DCMAKE_INSTALL_PREFIX=${{env.INSTALL_DIR}} ${{matrix.config.build_options}}
- uses: ammaraskar/gcc-problem-matcher@master
# Disabled for `act`
if: ${{ !env.ACT }}
- name: Build
shell: bash
# Build your program with the given configuration
run: |
${{matrix.config.precommand}}
cmake --build ${{env.BUILD_DIR}} --config ${{matrix.config.build_type}} -j $(nproc)
# - name: ccache status
# run: ccache -s
- name: Test
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# OMPI_ALLOW_RUN_AS_ROOT are set in script to allow `act` to work (env section was not working)
# ASAN_OPTIONS=detect_leaks=0 to disable memory leak detection for now
run: |
${{matrix.config.precommand}}
cd ${{env.BUILD_DIR}}
ctest -V -C ${{matrix.config.build_type}}
env:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
ASAN_OPTIONS: detect_leaks=0
- name: Install
shell: bash
run: |
${{matrix.config.precommand}}
cd ${{env.BUILD_DIR}} && cmake --install ${{env.BUILD_DIR}}
- name: TestInstallHypre
shell: bash
run: |
${{matrix.config.precommand}}
cmake -B ${{env.BUILD_DIR}}/hypre -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} -DCMAKE_PREFIX_PATH=${{env.INSTALL_DIR}} ${{env.INSTALL_DIR}}/share/doc/Alien/examples/hypre
cmake --build ${{env.BUILD_DIR}}/hypre