-
Notifications
You must be signed in to change notification settings - Fork 227
168 lines (150 loc) · 5.39 KB
/
Copy pathbuild.yaml
File metadata and controls
168 lines (150 loc) · 5.39 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
name: Build and Test
permissions: {}
on:
push:
branches: [segyio-1.x]
pull_request:
branches: [segyio-1.x]
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
name: Build and test ${{ matrix.build_type }} on ${{ matrix.os }} ${{ matrix.compiler }} ${{ matrix.cmake_generator }} BUILD_PYTHON=${{ matrix.build_python }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
cmake_generator: "-G \"Visual Studio 17 2022\" -A x64"
build_type: "Release"
compiler_flags: "-D_CRT_SECURE_NO_WARNINGS /EHsc"
build_python: "OFF"
- os: windows-2022
cmake_generator: "-G \"Visual Studio 17 2022\" -A x64"
build_type: "Debug"
compiler_flags: "-D_CRT_SECURE_NO_WARNINGS /EHsc"
build_python: "OFF"
- os: windows-2022
cmake_generator: "-G \"Visual Studio 17 2022\" -A Win32"
build_type: "Release"
compiler_flags: "-D_CRT_SECURE_NO_WARNINGS /EHsc"
build_python: "OFF"
- os: ubuntu-latest
privledges: "sudo"
build_type: "Release"
build_python: "OFF"
- os: ubuntu-latest
privledges: "sudo"
build_type: "Debug"
compiler_flags: "-Wextra -Wall -pedantic"
build_python: "OFF"
- os: ubuntu-latest
privledges: "sudo"
build_type: "Debug"
compiler_flags: "-Wextra -Wall -pedantic"
build_python: "ON"
- os: ubuntu-latest
privledges: "sudo"
compiler: "clang"
mkdoc: "-DBUILD_DOC=ON -DSPHINX_ARGS=-WT"
build_type: "Release"
build_python: "OFF"
- os: ubuntu-latest
privledges: "sudo"
compiler: "clang"
build_type: "Debug"
compiler_flags: "-Wextra -Wall -pedantic"
build_python: "OFF"
- os: macos-15-intel
privledges: "sudo"
build_type: "Release"
build_python: "OFF"
- os: macos-latest
privledges: "sudo"
build_type: "Release"
build_python: "OFF"
- os: macos-latest
privledges: "sudo"
build_type: "Debug"
compiler_flags: "-Wextra -Wall -pedantic"
build_python: "ON"
steps:
- uses: actions/checkout@v4
- name: Install clang toolchain
if: ${{ matrix.compiler == 'clang' }}
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install clang clang-tools
echo "CC=/usr/bin/clang" >> $GITHUB_ENV
echo "CXX=/usr/bin/clang++" >> $GITHUB_ENV
# Required to be able to install Python packages on MacOS
- uses: actions/setup-python@v6
if: ${{ matrix.build_python == 'ON' }}
with:
python-version: '3.13'
- name: Install build/test for Python dependencies
working-directory: python
if: ${{ matrix.build_python == 'ON' }}
run: |
python3 -m pip install -r requirements-dev.txt
- name: Configure
shell: bash
run: |
cmake -S . -B build \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBUILD_PYTHON=${{ matrix.build_python }} \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
-DCMAKE_INSTALL_NAME_DIR=/usr/local/lib \
-DCMAKE_C_FLAGS="${{ matrix.compiler_flags }}" \
-DCMAKE_CXX_FLAGS="${{ matrix.compiler_flags }}" \
${{ matrix.mkdoc }} \
${{ matrix.cmake_generator }} \
- name: Build and Install
shell: bash
run: |
${{ matrix.privledges }} cmake \
--build build \
--config ${{ matrix.build_type }} \
--target install \
- name: Test
shell: bash
run: |
cd build
ctest -C ${{ matrix.build_type }} --output-on-failure -V
matlab:
runs-on: ubuntu-latest
name: Build and test matlab code
steps:
- uses: actions/checkout@v4
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v2
- name: Configure
shell: bash
run: |
cmake -S . -B build \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBUILD_PYTHON=OFF \
-DBUILD_MEX=ON \
-DBUILD_BIN=OFF \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_NAME_DIR=/usr/local/lib \
- name: Build and Install
shell: bash
run: |
sudo cmake \
--build build \
--config Release \
--target install \
- name: Set LD_LIBRARY_PATH
run: echo "LD_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV
- name: Run 'segy.m' test script
uses: matlab-actions/run-command@v2
with:
command: addpath('build/mex'), try, run('build/mex/test/segy.m'), exit(0), catch ME, disp(getReport(ME, 'extended')), exit(-1), end;
- name: Run 'segyspec.m' test script
uses: matlab-actions/run-command@v2
with:
command: addpath('build/mex'), try, run('build/mex/test/segyspec.m'), exit(0), catch ME, disp(getReport(ME, 'extended')), exit(-1), end;