Skip to content

Changelog 2.0 alpha #291

Changelog 2.0 alpha

Changelog 2.0 alpha #291

Workflow file for this run

name: Run analyzers
permissions: {}
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
cppcheck:
name: cppcheck on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
cppcheck_install_command: sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get -y install cppcheck
- os: macos-latest
cppcheck_install_command: brew install cppcheck
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
${{ matrix.cppcheck_install_command }}
- name: Configure
run: |
cmake -S . -B build \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBUILD_PYTHON=OFF \
-DBUILD_TESTING=OFF
- name: Run cppcheck
run: |
cppcheck \
--enable=style,portability,performance,warning \
--library=posix \
--library=cppcheck/segyio.cfg \
--suppressions-list=cppcheck/suppressions.txt \
--inline-suppr \
--project=build/compile_commands.json \
--error-exitcode=1 \
--check-level=exhaustive
scan_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install clang clang-tools libfindbin-libs-perl
- name: Configure segyio
run: |
scan-build --status-bugs \
cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_PYTHON=OFF \
-DBUILD_TESTING=OFF
- name: Run scan-build
run: |
scan-build --status-bugs \
cmake \
--build build
valgrind:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install valgrind
- name: Build segyio
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS_DEBUG="-g -O0" \
-DCMAKE_CXX_FLAGS_DEBUG="-g -O0" \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_PYTHON=OFF
cmake --build build
- name: Run valgrind on C tests, file
working-directory: build/lib
run: |
valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1 ./c.segy "[c.segy]"
- name: Run valgrind on C tests, mmap
working-directory: build/lib
run: |
valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1 ./c.segy "[c.segy]" "--test-mmap"
- name: Run valgrind on C++ tests
working-directory: build/lib
run: |
valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1 ./c.segy "[c++]"
valgrind-python-invalid-memory-access:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install valgrind
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install build/test dependencies
working-directory: python
run: |
python -m pip install -r requirements-dev.txt
- name: Configure
run: |
cmake -S . -B build \
-DBUILD_PYTHON=ON \
-DBUILD_TESTING=OFF \
-DBUILD_BIN=OFF \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS_DEBUG="-g -O0" \
-DCMAKE_CXX_FLAGS_DEBUG="-g -O0" \
-DBUILD_SHARED_LIBS=ON \
- name: Build
run: |
cmake --build build
- name: Run valgrind memcheck on default pytests
run: |
cd python
# test_no_16bit_overflow_tracecount is too large for valgrind, so skip
# only "invalid memory access" checks. "Memory leaks" would be caused by python anyway.
valgrind --tool=memcheck --error-exitcode=1 pytest -rPV -k 'not test_no_16bit_overflow_tracecount'