-
Notifications
You must be signed in to change notification settings - Fork 35
186 lines (160 loc) · 6.29 KB
/
continuous_integration.yml
File metadata and controls
186 lines (160 loc) · 6.29 KB
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
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: [self-hosted, Linux, external]
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 \
--rm \
--target bitpit-environment \
-f bitpit/environments/ubuntu/Dockerfile .
- name: Cleanup build environment information
run: |
rm -rf bitpit
tests-linux:
runs-on: [self-hosted, Linux, external]
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 \
--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 \
--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: [self-hosted, win11, external]
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
echo preloading build tools variables
call C:\BuildTools\VC\Auxiliary\Build\vcvars64.bat
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-mpi"
IF "${{ matrix.mpi }}" == "OFF" (set "PETSC_DIR=C:\petsc")
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-v1.80.0\lib\cmake\Boost-1.80.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-v5.1.0\")
set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DPETSC_DIR=%PETSC_DIR%"
cmake.exe -G "Visual Studio 17 2022" %CMAKE_VARIABLES% ..
echo Build bitpit
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%
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
set "PATH=%PATH%;C:\optimad-dependencies\boost-v1.80.0\lib"
IF "${{ matrix.mpi }}" == "ON" (set "PATH=%PATH%;C:\optimad-dependencies\Metis-v5.1.0\lib\")
set "PETSC_DIR=C:\petsc-mpi"
IF "${{ matrix.mpi }}" == "OFF" (set "PETSC_DIR=C:\petsc")
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%