Skip to content

Using datatype when reading fields instead of byte size #194

Using datatype when reading fields instead of byte size

Using datatype when reading fields instead of byte size #194

Workflow file for this run

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-2019
cmake_generator: "-G \"Visual Studio 16 2019\" -A x64"
build_type: "Release"
compiler_flags: "-D_CRT_SECURE_NO_WARNINGS /EHsc"
- os: windows-2019
cmake_generator: "-G \"Visual Studio 16 2019\" -A x64"
build_type: "Debug"
compiler_flags: "-D_CRT_SECURE_NO_WARNINGS /EHsc"
- os: windows-2019
cmake_generator: "-G \"Visual Studio 16 2019\" -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;