-
Notifications
You must be signed in to change notification settings - Fork 34
188 lines (163 loc) · 6.69 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
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-linux:
runs-on: ubuntu
name: Setup - Linux
steps:
- name: Checkout build environment information
uses: actions/checkout@v4
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@v4
- 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: OFF
debug: OFF
- mpi: ON
debug: OFF
- mpi: OFF
debug: ON
- mpi: ON
debug: ON
steps:
- uses: actions/checkout@v4
- name: Build bitpit
shell: cmd
run: |
echo OFF
echo Prepare environment
REM Calling setvars.bat works properly only if called with call statement.
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
IF %SETVARS_COMPLETED% == 1 (echo MKL status.......... Loaded) else (echo MKL status.......... Error)
IF "${{ matrix.mpi }}" == "ON" (echo Parallel paradigm... MPI) else (echo Parallel paradigm... Serial)
IF "${{ matrix.debug }}" == "ON" (set "BUILD_TYPE=Debug") ELSE (set "BUILD_TYPE=Release")
echo Build type.......... %BUILD_TYPE%
set "PETSC_DIR=C:\petsc\3_19_5"
IF "${{ matrix.mpi }}" == "OFF" (set "PETSC_DIR=%PETSC_DIR%SERIAL")
echo PETSc directory..... %PETSC_DIR%
set "INSTALL_DIR=%cd%/install"
IF exist %INSTALL_DIR% (rmdir /q /s "%INSTALL_DIR%")
mkdir "%INSTALL_DIR%"
set "BUILD_DIR=%cd%/build"
IF exist "%BUILD_DIR%" (rmdir /q /s "%BUILD_DIR%")
mkdir "%BUILD_DIR%"
echo Enter build directory
cd "%BUILD_DIR%"
echo Configure bitpit
set "CMAKE_VARIABLES="
set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DBoost_USE_STATIC_LIBS=OFF"
set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DBOOST_ROOT:PATH=C:\optimad-dependencies\boost\lib\cmake\Boost-1.82.0"
set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DBITPIT_BUILD_EXAMPLES=ON"
set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DBITPIT_ENABLE_INTEGRATION_TESTS=ON"
set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DBITPIT_ENABLE_MPI=${{ matrix.mpi }}"
set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DBITPIT_ENABLE_UNIT_TESTS=ON"
set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DBUILD_SHARED_LIBS=ON"
set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DBUILD_TESTING=ON"
set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DCMAKE_BUILD_TYPE=%BUILD_TYPE%"
set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DCMAKE_CONFIGURATION_TYPES=%BUILD_TYPE%"
set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR%"
set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON"
IF "${{ matrix.mpi }}" == "ON" (set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DMETIS_DIR=C:\optimad-dependencies\metis-5.1.0-win\dynamic\")
set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DPETSC_DIR=%PETSC_DIR%"
"C:\Program Files\CMake\bin\cmake.exe" -G "Visual Studio 17 2022" %CMAKE_VARIABLES% ..
echo Build bitpit
"C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" INSTALL.vcxproj /p:Configuration=%BUILD_TYPE% /p:Platform=x64 /m:8
- name: Run bitpit tests
shell: cmd
if: matrix.debug == 'OFF'
run: |
echo OFF
echo Prepare environment
set "INSTALL_DIR=%cd%/install"
set "BUILD_DIR=%cd%/build"
IF "${{ matrix.debug }}" == "ON" (set "BUILD_TYPE=Debug") ELSE (set "BUILD_TYPE=Release")
echo Build type.......... %BUILD_TYPE%
set "PATH=%PATH%;C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\intel64_win\compiler\"
set "PATH=%PATH%;C:\Program Files (x86)\Intel\oneAPI\mkl\latest\redist\intel64\"
set "PATH=%PATH%;C:\optimad-dependencies\boost\lib"
IF "${{ matrix.mpi }}" == "ON" (set "PATH=%PATH%;C:\optimad-dependencies\metis-5.1.0-win\dynamic\lib\")
set "PETSC_DIR=C:\petsc\3_19_5"
IF "${{ matrix.mpi }}" == "OFF" (set "PETSC_DIR=%PETSC_DIR%SERIAL")
set "PATH=%PATH%;%PETSC_DIR%\lib"
set "PATH=%PATH%;%INSTALL_DIR%/bin"
echo Enter build directory
cd "%BUILD_DIR%"
echo Run tests
ctest.exe --output-on-failure -C %BUILD_TYPE%