Add nifti exporter for dpv #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| # Cancel in-flight runs when a new commit is pushed to the same PR/branch. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| rust-tests: | |
| name: Rust tests (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| # Build only the odx-rs core here. odx-py is a Python cdylib whose | |
| # link step needs `-undefined dynamic_lookup` on macOS (configured in | |
| # python/.cargo/config.toml, only visible when cargo runs from | |
| # python/). The actual cdylib build happens in the python-tests job | |
| # via maturin, which sets the right flags. We `cargo check` it here | |
| # so Rust-level errors are still caught — `check` skips codegen and | |
| # linking entirely. | |
| - name: cargo build (odx-rs) | |
| run: cargo build -p odx-rs --all-targets | |
| - name: cargo check (odx-py) | |
| run: cargo check -p odx-py | |
| - name: cargo test (odx-rs) | |
| run: cargo test -p odx-rs --lib | |
| - name: cargo test (integration) | |
| run: cargo test -p odx-rs --tests | |
| python-tests: | |
| name: Python tests (${{ matrix.os }} / py${{ matrix.python-version }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| python-version: ['3.10', '3.12'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| # `maturin develop` requires an active virtualenv (it refuses to | |
| # install into the system Python). Create one inside python/ and | |
| # activate it for the remainder of the job by exporting VIRTUAL_ENV | |
| # and prepending its bin/ directory to PATH. | |
| - name: Create + activate virtualenv | |
| working-directory: python | |
| run: | | |
| python -m venv .venv | |
| echo "VIRTUAL_ENV=$PWD/.venv" >> "$GITHUB_ENV" | |
| echo "$PWD/.venv/bin" >> "$GITHUB_PATH" | |
| - name: Install build + test deps | |
| working-directory: python | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install maturin pytest numpy | |
| - name: Build + install (maturin develop) | |
| working-directory: python | |
| run: maturin develop --release | |
| - name: Run odx-py tests | |
| working-directory: python | |
| run: pytest tests/ -v |