-
Notifications
You must be signed in to change notification settings - Fork 227
136 lines (120 loc) · 4.26 KB
/
Copy pathbuild.yaml
File metadata and controls
136 lines (120 loc) · 4.26 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
name: Build and Test
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
name: Build and test ${{ matrix.build_type }} on ${{ matrix.os }} ${{ matrix.compiler }} ${{ matrix.cmake_generator }}
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"
- os: windows-2022
cmake_generator: "-G \"Visual Studio 17 2022\" -A x64"
build_type: "Debug"
compiler_flags: "-D_CRT_SECURE_NO_WARNINGS /EHsc"
- os: windows-2022
cmake_generator: "-G \"Visual Studio 17 2022\" -A Win32"
build_type: "Release"
compiler_flags: "-D_CRT_SECURE_NO_WARNINGS /EHsc"
- os: ubuntu-latest
privledges: "sudo"
build_type: "Release"
- os: ubuntu-latest
privledges: "sudo"
build_type: "Debug"
compiler_flags: "-Wextra -Wall -pedantic"
- os: ubuntu-latest
privledges: "sudo"
compiler: "clang"
mkdoc: "-DBUILD_DOC=ON -DSPHINX_ARGS=-WT"
build_type: "Release"
- os: ubuntu-latest
privledges: "sudo"
compiler: "clang"
build_type: "Debug"
compiler_flags: "-Wextra -Wall -pedantic"
- os: macos-13
privledges: "sudo"
build_type: "Release"
- os: macos-latest
privledges: "sudo"
build_type: "Release"
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
- name: Configure
shell: bash
run: |
cmake -S . -B build \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBUILD_PYTHON=OFF \
-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;