Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 0 additions & 147 deletions .clang-tidy

This file was deleted.

12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true
indent_style = space
max_line_length = 100

[*.py]
indent_style = space
indent_size = 4

[*.{c,cc,h,cpp,hpp}]
indent_size = 2

[*.md]
indent_size = 4
max_line_length = 120

[*.{yaml,yml}]
indent_size = 2
58 changes: 42 additions & 16 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,66 @@
name: Clang CI
name: CI

on:
push:
branches: [ "*" ]
branches:
- "main"
pull_request:
branches: [ "main" ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
BUILD_TYPE: Release

jobs:
build_test:
cpp_tests:
name: "C++ Unit Tests"
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
# The CMake configure and build commands are platform-agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
- name: 'Install dependencies'
run: sudo apt-get install -y cmake pybind11-dev

- name: 'Configure CMake'
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
# Build your program with the given configuration
- name: 'Build'
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
- name: 'Test'
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}

python_tests:
name: "Python Tests"
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.10', '3.11', '3.12', '3.13' ]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: 'Set up Python'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: 'Install uv'
uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "**/pyproject.toml"
enable-cache: true

- name: 'Install dependencies'
run: uv sync --locked --all-extras --dev

- name: 'Run unit tests'
run: uv run pytest -n auto
57 changes: 43 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
# Compiled Object files
# General
**/.DS_Store
**/*.bak*
*.log

## C/C++
build/**/*
include/*
lib/*
bin/*
Testing
tests/Temporary
*.bin
*.slo
*.lo
*.o
*.obj

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Executables
*.exe
*.out
*.app

# Google Test
googletest/
_deps
libseis_test[1]_include.cmake
**/*.cmake

# Cmake
**/cmake-build-debug
**/CMakeCache.txt
Expand All @@ -26,14 +39,30 @@
**/*.cbp
**/CMakeScripts
**/compile_commands.json
build.ninja
.cmake/

## Local
# IDE
.idea/
build/**/*
include/*
lib/*
bin/*
test/test_runner
Testing
test/Temporary
*.bin
.vscode/

# Python
venv/
.venv/
*.egg-info/
.ipynb_checkpoints/
.mypy_cache/
.ruff_cache/
/data/
/media/
__pycache__/
_build/
build/
dist/
.coverage*
coverage.*
log.html
output.xml
.pytest_cache/
report.html
coverage_html/
65 changes: 65 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# To use:
#
# pre-commit run -a
#
# Or:
#
# pre-commit install # (runs every time you commit in git)
#
# To update this file:
#
# pre-commit autoupdate
#
# See https://github.com/pre-commit/pre-commit

ci:
autoupdate_commit_msg: "chore: update pre-commit hooks"
autofix_commit_msg: "style: pre-commit fixes"

repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
exclude: ^conda\.recipe/meta\.yaml$
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: trailing-whitespace

# Check linting and style issues
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.11.12"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
- id: ruff-format
exclude: ^(docs)

# Changes tabs to spaces
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: remove-tabs
exclude: ^(docs)

# CMake formatting
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
additional_dependencies: [pyyaml]
types: [file]
files: (\.cmake|CMakeLists.txt)(.in)?$

# .clang-format file
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v13.0.0
hooks:
- id: clang-format
Loading