Scale read shape according to per-dim weights and priority (#53) #176
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: {} | |
| workflow_dispatch: {} | |
| concurrency: | |
| # on main, group = workflow-run_id | |
| # on PR, group = workflow-PR_number | |
| group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: ubuntu-22.04 | |
| defaults: | |
| run: | |
| shell: bash | |
| permissions: | |
| contents: read | |
| checks: write | |
| steps: | |
| ############ Setup ############ | |
| - name: Repo checkout | |
| uses: actions/checkout@v7 | |
| - name: Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: 1.89.0 | |
| components: rustfmt, clippy | |
| cache-workspaces: | | |
| jix | |
| jix-macros | |
| jix/schema | |
| jix-py | |
| - uses: taiki-e/install-action@cargo-hack | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: 3.13 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: 3.13 | |
| activate-environment: true | |
| - name: Install Python dependencies | |
| run: | | |
| python -m ensurepip | |
| uv pip install -r scripts/dev_requirements.txt | |
| - name: Install Protoc | |
| uses: arduino/setup-protoc@v3 | |
| ############ Format ############ | |
| - name: Format jix-schema | |
| run: cargo fmt --all -- --check | |
| working-directory: jix/schema | |
| - name: Format jix-macros | |
| run: cargo fmt --all -- --check | |
| working-directory: jix-macros | |
| - name: Format jix | |
| run: cargo fmt --all -- --check | |
| working-directory: jix | |
| - name: Format jix-py (cargo) | |
| run: cargo fmt --all -- --check | |
| working-directory: jix-py | |
| - name: Format jix-py (ruff) | |
| uses: astral-sh/ruff-action@v3 | |
| with: | |
| args: --config .ruff.toml format --check --diff | |
| version: 0.16.x | |
| - name: Check only ASCII | |
| run: python scripts/check_only_ascii.py | |
| ############ Build ############ | |
| - name: Build jix-schema | |
| run: cargo build | |
| working-directory: jix/schema | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| - name: Build jix-macros | |
| run: cargo build | |
| working-directory: jix-macros | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| - name: Build jix | |
| run: cargo build | |
| working-directory: jix | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| - name: Build jix-py | |
| run: cargo build | |
| working-directory: jix-py | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| # cargo check with feature powerset | |
| - name: cargo check jix with feature powerset | |
| run: cargo hack check --feature-powerset --depth 2 | |
| working-directory: jix | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| # install jix-py into venv | |
| - name: install jix-py | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| command: develop | |
| args: --uv | |
| sccache: "true" | |
| working-directory: jix-py | |
| ############ Docs ############ | |
| - name: jix docs | |
| run: cargo doc | |
| working-directory: jix | |
| - name: jix-py docs pyi | |
| run: cargo run --bin generate_pyi | |
| working-directory: jix-py | |
| - name: jix-py docs mkdocs | |
| run: mkdocs build --strict | |
| working-directory: jix-py | |
| ############ Linters ############ | |
| - name: Clippy jix-schema | |
| run: cargo clippy --all-features | |
| working-directory: jix/schema | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| - name: Clippy jix-macros | |
| run: cargo clippy --all-features | |
| working-directory: jix-macros | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| - name: Clippy jix | |
| run: cargo clippy --all-features | |
| working-directory: jix | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| - name: Clippy jix-py | |
| run: cargo clippy --all-features | |
| working-directory: jix-py | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| - name: Ruff jix-py | |
| uses: astral-sh/ruff-action@v3 | |
| with: | |
| args: --config .ruff.toml check | |
| version: 0.16.x | |
| # - name: Check schema is up to date | |
| # run: | | |
| # pushd schema; cargo run; popd | |
| # git diff --exit-code | |
| # working-directory: jix | |
| - name: Protobuf Buf linter | |
| uses: bufbuild/buf-action@v1 | |
| with: | |
| version: 1.71.0 | |
| input: jix/schema/proto | |
| format: true | |
| lint: true | |
| breaking: false | |
| push: false | |
| archive: false | |
| pr_comment: false | |
| ############ Tests ############ | |
| - name: Test jix-macros | |
| run: cargo test | |
| working-directory: jix-macros | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| - name: Test jix | |
| run: cargo test --all-features | |
| working-directory: jix | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| - name: Test jix-py (Rust tests) | |
| run: cargo test --all-features --all-targets | |
| working-directory: jix-py | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| - name: Test jix-py (Python tests) | |
| run: pytest python/tests --numprocesses auto | |
| working-directory: jix-py | |
| - name: Install benchmark dependencies | |
| run: uv pip install -r jix-py/python/benches/requirements.txt | |
| - name: Test bench harness | |
| run: pytest python/benches/tests --numprocesses auto | |
| working-directory: jix-py | |
| - name: Test bench compare | |
| run: pytest scripts/tests --numprocesses auto | |
| rust-version-check-clippy: | |
| # check that we can build using different rust versions: | |
| # - the minimal rust version that is specified by this crate | |
| # - the latest stable version | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| rust-version: ["msrv", "stable"] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install toml-cli using cargo | |
| uses: baptiste0928/cargo-install@v3 | |
| with: | |
| crate: toml-cli | |
| version: "^0.2" | |
| - name: Determine Rust version | |
| id: rust-version | |
| run: | | |
| if [ "${{ matrix.rust-version }}" = "stable" ]; then | |
| rust_version="stable" | |
| else | |
| rust_version=$(toml get Cargo.toml package.rust-version --raw) | |
| fi | |
| echo "Rust version: '$rust_version'" | |
| echo "rust_version=$rust_version" >> "$GITHUB_OUTPUT" | |
| working-directory: jix | |
| - name: Install Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: ${{ steps.rust-version.outputs.rust_version }} | |
| components: clippy | |
| cache-workspaces: | | |
| jix | |
| jix-py | |
| - name: cargo check jix | |
| run: cargo check --all-features | |
| working-directory: jix | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| - name: cargo clippy jix | |
| run: cargo clippy --all-features | |
| working-directory: jix | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| - name: cargo check jix-py | |
| run: cargo check --all-features | |
| working-directory: jix-py | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| - name: cargo clippy jix-py | |
| run: cargo clippy --all-features | |
| working-directory: jix-py | |
| env: | |
| RUSTFLAGS: "-D warnings" |