Skip to content

fix: two files shipped in 0.3.0 that cannot compile from a tarball, a… #146

fix: two files shipped in 0.3.0 that cannot compile from a tarball, a…

fix: two files shipped in 0.3.0 that cannot compile from a tarball, a… #146

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
python-checks:
name: ruff + ty
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# The 13 `.py` files here are this repository's automation, not a package,
# so there is nothing to install — `uvx` fetches the tools and runs them.
# Configuration for both lives in the repository's pyproject.toml.
- uses: astral-sh/setup-uv@v5
- name: ruff check
run: uvx ruff check .
- name: ruff format
run: uvx ruff format --check .
# Python is where this repository's automation lives, so it is checked
# like the Rust is. `ty` is astral's, like ruff and uv above.
- name: ty
run: uvx ty check scripts tests
go-skiff-reference:
name: pinned Go Skiff reference
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: "1.25.x"
- name: Go SDK v0.0.33 Skiff vectors
working-directory: tests/skiff-go-interop
run: go test ./...
go-rpc-reference:
name: pinned Go RPC wire-format reference
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: "1.25.x"
# Regenerates the byte vectors the Rust tests consume, and fails if the
# Go SDK's own encoder and decoder disagree. `git diff --exit-code`
# afterwards is what catches a vector that has silently changed: the
# checked-in files must be exactly what the pinned SDK produces.
- name: Go SDK v0.0.33 RPC vectors
working-directory: tests/rpc-go-interop
run: go test ./...
- name: The checked-in vectors are the ones the Go SDK produces
run: git diff --exit-code -- tests/rpc-go-interop
check:
name: fmt + clippy + test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# `ytsaurus-proto`'s bindings are committed, so the build no longer needs
# this — the drift check below does. Not `submodules: true` on the
# checkout above: that clones the whole YTsaurus monorepo, and the script
# takes the shallow, sparse path that fetches only `yt/yt_proto/`.
- name: Check out the YTsaurus protos
run: ./scripts/init-protos.sh
# rust-toolchain.toml pins the channel, components and targets.
- name: Install toolchain
run: rustup show active-toolchain || rustup toolchain install
- uses: Swatinem/rust-cache@v2
# The committed bindings must be exactly what the pinned submodule
# produces. Same shape as the Go RPC vector check above, and for the same
# reason: generated code that is committed can drift from its source, and
# the only thing that catches it is regenerating and diffing.
- name: The committed protobuf bindings are the ones the submodule produces
run: |
cargo xtask generate-protos
git diff --exit-code -- crates/ytsaurus-proto/src/generated
# `include_str!`/`include_bytes!` resolve at compile time, so a published
# file reaching outside its own crate builds here and cannot build from a
# tarball. `cargo package` does not catch it — it verifies by building the
# library, not the tests — and 0.3.0 shipped two such files because the
# check for them was a line-based grep and the macros had newlines in
# them. This parses instead.
- name: No published file reaches outside its own crate
run: python3 scripts/check_package_includes.py
- name: cargo fmt --check
run: cargo fmt --all -- --check
- name: cargo clippy
run: cargo clippy --workspace --all-targets -- -D warnings
# The client without TLS is what a worker binary links against, and the
# `https://` refusal only exists in that build. Nothing else compiles it.
- name: cargo clippy (client without TLS)
run: cargo clippy -p ytsaurus-client --no-default-features --all-targets -- -D warnings
# `derive` and `tracing` are both off by default, so the workspace build
# compiles neither the macro against the client's own types nor the spans
# and the `tracing`-shaped retry reporting. Clippy as well as the tests:
# the two spellings of `observe` are separate code, and only one of them
# is linted above.
- name: cargo clippy (client with every feature)
run: cargo clippy -p ytsaurus-client --all-features --all-targets -- -D warnings
- name: cargo test (client with every feature)
run: cargo test -p ytsaurus-client --all-features
# The workers are examples of `ytsaurus-job`, and the end-to-end tests
# below exec them. `--all-targets` does not build a runnable one — there
# `--examples` means *test* the examples, so each is compiled as a libtest
# harness and no plain binary is produced — and `tests/common::example`
# answers that by building what it needs. Doing it here as well is not
# redundant: it builds the nine once, before any test runs, instead of
# leaving several test binaries to discover the gap at the same moment and
# queue behind each other on cargo's lock.
- name: Build the worker examples the e2e tests run
run: cargo build -p ytsaurus-job --examples
- name: cargo test
run: cargo test --workspace --all-targets
# `--all-targets` skips doctests, and the mapper example in the
# ytsaurus-job docs must keep compiling.
- name: cargo test --doc
run: cargo test --workspace --doc
# `--all-targets` also skips `#[ignore]`d tests, so the 2 GB streaming
# test needs its own step or it never runs. It is the only guard against
# the reader silently starting to accumulate input: ~10 s in debug, and
# it asserts peak RSS stays far below the budget.
- name: cargo test (2 GB streaming memory test)
run: cargo test -p ytsaurus-job --test memory_tests -- --ignored --nocapture
musl:
name: static musl worker build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# No `init-protos.sh` here: the worker graph does not reach
# `ytsaurus-proto`, and since its bindings are committed nothing in this
# workspace needs the submodule to *build* at all.
- name: Install toolchain
run: rustup show active-toolchain || rustup toolchain install
- uses: Swatinem/rust-cache@v2
# Why this check is shaped the way it is — the sentinel, and why a bare
# `cargo tree -i` was the wrong instrument — is in the script's docstring.
- name: Assert the worker graph has no tracing and no TLS
run: python3 scripts/check_worker_graph.py
# Through the script rather than a bare cargo call: the script is what
# stages each example from `<profile>/examples/<name>` into
# `<profile>/<name>`, which is the layout the assertion below and every
# document in the repository expect. Running it here also means the thing
# contributors run is the thing CI exercises.
- name: Build worker binaries
run: ./scripts/build-worker.sh
- name: Assert binaries are statically linked
run: python3 scripts/check_worker_binaries.py