-
Notifications
You must be signed in to change notification settings - Fork 34
189 lines (171 loc) · 7.04 KB
/
continuous_integration.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
name: Continuous integration
on:
workflow_dispatch:
inputs:
pull_request:
branches: [ "master" ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
# setup-lnux:
# runs-on: ubuntu
# name: Setup - Linux
# steps:
# - name: Checkout build environment information
# uses: actions/checkout@v3
# with:
# path: bitpit
# sparse-checkout: |
# environments
# - name: Build environment
# shell: bash
# run: |
# DOCKER_BUILDKIT=1 docker buildx build \
# --builder=container \
# --cache-from type=local,src=/home/bob/products/bitpit/ubuntu-cache \
# --cache-to type=local,dest=/home/bob/products/bitpit/ubuntu-cache \
# --rm \
# --target bitpit-environment \
# -f bitpit/environments/ubuntu/Dockerfile .
# - name: Cleanup build environment information
# run: |
# rm -rf bitpit
# tests-linux:
# runs-on: ubuntu
# needs: setup-linux
# name: Linux - (${{ matrix.compiler }}) MPI ${{ matrix.mpi }} - Debug ${{ matrix.debug }}
# strategy:
# fail-fast: false
# matrix:
# include:
# - compiler: gcc
# mpi: ON
# debug: ON
# - compiler: gcc
# mpi: ON
# debug: OFF
# - compiler: gcc
# mpi: OFF
# debug: ON
# - compiler: gcc
# mpi: OFF
# debug: OFF
# - compiler: clang
# mpi: ON
# debug: OFF
# steps:
# - name: Checkout bitpit
# uses: actions/checkout@v3
# - name: Build bitpit
# shell: bash
# run: |
# DOCKER_BUILDKIT=1 docker buildx build \
# --builder=container \
# --cache-from type=local,src=/home/bob/products/bitpit/ubuntu-cache \
# --rm \
# --build-arg COMPILER=${{ matrix.compiler }} \
# --build-arg MPI=${{ matrix.mpi }} \
# --build-arg DEBUG=${{ matrix.debug }} \
# --target bitpit-build \
# -f environments/ubuntu/Dockerfile .
# - name: Run bitpit tests
# shell: bash
# run: |
# DOCKER_BUILDKIT=1 docker buildx build \
# --builder=container \
# --cache-from type=local,src=/home/bob/products/bitpit/ubuntu-cache \
# --rm \
# --build-arg COMPILER=${{ matrix.compiler }} \
# --build-arg MPI=${{ matrix.mpi }} \
# --build-arg DEBUG=${{ matrix.debug }} \
# --target bitpit-test \
# -f environments/ubuntu/Dockerfile .
tests-windows:
runs-on: Windows
name: Windows - (MSVC) MPI ${{ matrix.mpi }} - Debug ${{ matrix.debug }}
strategy:
fail-fast: false
matrix:
include:
- mpi: ON
debug: ON
- mpi: ON
debug: OFF
- mpi: OFF
debug: ON
- mpi: OFF
debug: OFF
steps:
- uses: actions/checkout@v3
- name: Build bitpit
shell: cmd
run: |
echo OFF
echo preloading the mkl environment variable
REM calling setvars.bat works properly only if called with call statement.
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
echo "MKL loaded..... " %SETVARS_COMPLETED%
IF "${{ matrix.mpi }}" == "1" (echo "Parallel paradigms... MPI") else (echo "Parallel paradigms... Serial")
IF "${{ matrix.debug }}" == "1" (set "buildtype=Debug") ELSE (set "buildtype=Release")
echo "Build type..... " %buildtype%
set "petscdir=C:\petsc\3_19_5"
IF "${{ matrix.mpi }}" == "0" (set "petscdir=%petscdir%SERIAL")
echo "PETSc directory..... " %petscdir%
echo Set cmake configuration command
set "cmake-command="C:\Program Files\CMake\bin\cmake.exe" -G "Visual Studio 17 2022""
set "cmake-command=%cmake-command% -DBITPIT_BUILD_EXAMPLES=ON
set "cmake-command=%cmake-command% -DBITPIT_BUILD_SHARED_LIBS=ON
set "cmake-command=%cmake-command% -DBITPIT_ENABLE_INTEGRATION_TESTS=ON \
set "cmake-command=%cmake-command% -DBITPIT_ENABLE_MPI=${{ matrix.mpi }} \
set "cmake-command=%cmake-command% -DBITPIT_ENABLE_UNIT_TESTS=ON \
set "cmake-command=%cmake-command% -DBUILD_TESTING=ON \
set "cmake-command=%cmake-command% -DCMAKE_BUILD_TYPE=%buildtype%""
set "cmake-command=%cmake-command% -DCMAKE_CONFIGURATION_TYPES=%buildtype%""
set "cmake-command=%cmake-command% -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON"
set "cmake-command=%cmake-command% -DMETIS_DIR=C:\optimad-dependencies\metis-5.1.0-win\dynamic\"
set "cmake-command=%cmake-command% -DPETSC_DIR=%petscdir%" \
set "cmake-command=%cmake-command% .."
%cmake-command%
echo Build bitpit
"C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" bitpit.sln /t:ALL_BUILD /p:Configuration=Release /p:Platform=x64
- name: Run bitpit tests
shell: powershell
run: |
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
# Copy dependencies and add them to PATH
# TODO: put the dependencies find and copy inside cmake files (everything apart mkl and curl can be found)
$WORKDIR ="$PWD\.."
Write-Host "MPI IS ? ${{ matrix.mpi }}"
if ("${{ matrix.mpi }}" -eq "1"){
$BITPIT_LIBS = "C:\bitpit\bitpit-libraries"
}else{
$BITPIT_LIBS = "C:\bitpit\bitpit-libraries-serial"
}
Write-Host "Collecting bitpit deps in $BITPIT_LIBS"
$BITPIT_DEPS = "C:\optimad-dependencies\"
if(Test-Path -Path $BITPIT_LIBS){
#removing forcefully the old libraries folder
Remove-Item $BITPIT_LIBS -Recurse -Force
}
#create an empty library folder
New-Item -Path $BITPIT_LIBS -ItemType Directory
cp "$BITPIT_DEPS\boost\lib\*.dll" $BITPIT_LIBS
cp -r "C:\Program Files (x86)\Intel\oneAPI\mkl\latest\redist\intel64\*" $BITPIT_LIBS
cp "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\intel64_win\compiler\*.dll" $BITPIT_LIBS
if ("${{ matrix.mpi }}" -eq "1"){
Write-Host "copying mpi, metis and MPI petsc"
cp "C:\Windows\System32\msmpi.dll" $BITPIT_LIBS
cp "$BITPIT_DEPS\metis-5.1.0-win\dynamic\lib\*.dll" $BITPIT_LIBS
cp "C:\petsc\3_19_5\lib\*.dll" $BITPIT_LIBS
}else{
Write-Host "copying serial petsc"
cp "C:\petsc\3_19_5SERIAL\lib\*.dll" $BITPIT_LIBS
}
cp "$WORKDIR\bitpit-install\bin\*.dll" $BITPIT_LIBS
# Set environment PATH
$env:Path += ";$BITPIT_LIBS"
# Run tests
cd build
$ctest_command = "ctest.exe -C Release"
Invoke-Expression $ctest_command