dtcs 0.12.0

Reference implementation of the Data Transformation Contract Standard (DTCS)
Documentation
name: Checks

on:
  workflow_call:

env:
  CARGO_TERM_COLOR: always

jobs:
  python:
    runs-on: ubuntu-24.04
    strategy:
      fail-fast: false
      matrix:
        python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}
          cache: pip
      - name: Build and test Python package
        run: |
          python -m venv .venv
          source .venv/bin/activate
          python -m pip install --upgrade pip
          python -m pip install "maturin>=1,<2" "pytest>=8,<9"
          maturin develop --no-default-features --features python --locked
          pytest python/tests -v
      - name: maturin build (dry run)
        if: matrix.python-version == '3.12'
        run: |
          source .venv/bin/activate
          maturin build --no-default-features --features python --locked

  rust:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
      - uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
      - name: cargo fmt
        run: cargo fmt --all -- --check
      - name: cargo clippy
        run: cargo clippy --all-targets -- -D warnings
      - name: cargo test
        run: cargo test --locked
      - name: conformance
        run: |
          cargo test --test phase_0_10 --locked
          cargo run --bin dtcs -- conformance run --profile all
      - name: documentation
        env:
          NO_MKDOCS_2_WARNING: "true"
        run: |
          python3 -m pip install --user -r docs/requirements.txt
          export PATH="$HOME/.local/bin:$PATH"
          ./scripts/check-docs.sh
      - name: wasm build
        run: |
          rustup target add wasm32-unknown-unknown
          cargo build --manifest-path bindings/wasm/Cargo.toml --target wasm32-unknown-unknown --release
      - name: wasm bindings test
        run: |
          cd bindings/wasm
          npm install --no-save wasm-pack@0.13.1 2>/dev/null || true
          npx wasm-pack build --target web --out-dir pkg || npm run build
          npm test
      - name: node bindings test
        run: |
          cd bindings/wasm && npx wasm-pack build --target web --out-dir pkg
          cd ../node && npm install --no-save file:../wasm && npm test
      - name: cargo build
        run: cargo build --locked --all-targets
      - name: cargo publish (dry run)
        run: cargo publish --dry-run --locked --allow-dirty