-
Notifications
You must be signed in to change notification settings - Fork 0
202 lines (187 loc) · 8.1 KB
/
compile_and_run_unittests.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
name: Compile And Run Unit Tests
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
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
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [[ubuntu-latest]] # Only ubuntu for now because of mkl
steps:
- uses: actions/checkout@v2
# ========= Create build directory =========
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commandss
run: cmake -E make_directory ${{github.workspace}}/build
# ========= Install MKL =========
- name: Intel Apt repository
timeout-minutes: 1
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
- name: Install Intel oneAPI
timeout-minutes: 5
run: sudo apt-get install intel-oneapi-mpi intel-oneapi-mpi-devel intel-oneapi-mkl-devel ninja-build
- name: Setup Intel oneAPI environment
run: |
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
# ========= Install Log4cxx =========
- name: Intel Apt repository
run: sudo apt-get install -y liblog4cxx-dev
# ========= Install NeoPZ =========
- name: Clone External NeoPZ
uses: actions/checkout@v2
with:
path: ./neopz
repository: labmec/neopz
ref: develop
- name: Set up build environment for External NeoPZ
shell: bash
working-directory: ${{github.workspace}}/neopz
run: cmake -E make_directory build
- name: Configure CMake External NeoPZ
shell: bash
working-directory: ${{github.workspace}}/neopz/build
run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DUSING_MKL=ON -DUSING_LOG4CXX=ON -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/neopz_install
- name: Build And Install External NeoPZ
working-directory: ${{github.workspace}}/neopz/build
shell: bash
run: cmake --build . --config $BUILD_TYPE --target install
env:
MAKEFLAGS: "-j4"
# ========= Install GMSH =========
- name: Clone External GMSH
run: (rm -rf ${{github.workspace}}/gmsh || echo "gmsh folder will be created on clone...") && git clone https://gitlab.onelab.info/gmsh/gmsh.git ${{github.workspace}}/gmsh
- name: Set up build environment for External GMSH
shell: bash
working-directory: ${{github.workspace}}/gmsh
run: cmake -E make_directory build
- name: Configure CMake External GMSH
shell: bash
working-directory: ${{github.workspace}}/gmsh/build
run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/gmsh_install -DENABLE_BUILD_SHARED=ON
- name: Build And Install External GMSH
working-directory: ${{github.workspace}}/gmsh/build
shell: bash
run: cmake --build . --config $BUILD_TYPE --target install
env:
MAKEFLAGS: "-j4"
# ========= Install DFNMesh =========
- name: Clone External DFNMesh
uses: actions/checkout@v2
with:
path: ./dfnmesh
repository: labmec/dfnMesh
ref: master
- name: Set up build environment for External DFNMesh
shell: bash
working-directory: ${{github.workspace}}/dfnmesh
run: cmake -E make_directory build
- name: Configure CMake External DFNMesh
shell: bash
working-directory: ${{github.workspace}}/dfnmesh/build
run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/dfnmesh_install
- name: Build And Install External DFNMesh
working-directory: ${{github.workspace}}/dfnmesh/build
shell: bash
run: cmake --build . --config $BUILD_TYPE --target install
env:
MAKEFLAGS: "-j4"
# ========= Install Eigen3 =========
- name: Clone External Eigen3
shell: bash
working-directory: ${{github.workspace}}
run: git clone https://gitlab.com/libeigen/eigen.git
- name: Change Branch of External Eigen3
shell: bash
working-directory: ${{github.workspace}}/eigen
run: git checkout 3.3
- name: Set up build environment for External Eigen3
shell: bash
working-directory: ${{github.workspace}}/eigen
run: cmake -E make_directory build
- name: Configure CMake External Eigen3
shell: bash
working-directory: ${{github.workspace}}/eigen/build
run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/eigen_install
- name: Build And Install External Eigen3
working-directory: ${{github.workspace}}/eigen/build
shell: bash
run: cmake --build . --config $BUILD_TYPE --target install
env:
MAKEFLAGS: "-j4"
# ========= Install Boost =========
- name: Install boost
uses: MarkusJx/[email protected]
id: install-boost
with:
boost_version: 1.73.0
platform_version: 18.04
# ========= Install LibInterpolate =========
- name: Clone External libInterpolate
uses: actions/checkout@v2
with:
path: ./libinterpolate
repository: CD3/libInterpolate
ref: master
- name: Set up build environment for External libinterpolate
shell: bash
working-directory: ${{github.workspace}}/libinterpolate
run: cmake -E make_directory build
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- name: Configure CMake External libinterpolate
shell: bash
working-directory: ${{github.workspace}}/libinterpolate/build
run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/libinterpolate_install
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- name: Build And Install External libinterpolate
working-directory: ${{github.workspace}}/libinterpolate/build
shell: bash
run: cmake --build . --config $BUILD_TYPE --target install
env:
MAKEFLAGS: "-j4"
# ========= Build iMRS =========
- name: Configure iMRS CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_UNITTESTING=ON -DUSING_DFN=ON
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- name: Build iMRS
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
env:
MAKEFLAGS: "-j4"
# ========= Run Unit Tests =========
- name: Run Unit Tests
working-directory: ${{github.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE
env:
CTEST_OUTPUT_ON_FAILURE: 1