Skip to content

Release WorkTable 1.10.0 beta1 #260

Release WorkTable 1.10.0 beta1

Release WorkTable 1.10.0 beta1 #260

Workflow file for this run

name: Rust
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
jobs:
# `scripts/ci-local.sh` runs `cargo fmt --all --check` as its first step. CI
# did not, which made the script stricter than CI instead of equal to it, and
# formatting drift reached master unnoticed. Same command, same arguments.
fmt:
name: Formatting
runs-on: ubicloud-standard-2
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Formatting (cargo fmt --all --check)
run: cargo fmt --all --check
build:
name: Build and test (${{ matrix.name }})
runs-on: ubicloud-standard-2
# A cold all-target workspace build plus compile-fail's nested Cargo checks
# exceeded 30 minutes when GitHub's cache service was unavailable. Keep
# enough room for a real from-scratch release gate.
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- name: default
args: ""
test_debug: 2
- name: versioned-publication
args: "--features versioned-row-publication"
test_debug: 2
- name: all-features
args: "--all-features"
# Full DWARF makes Rust 1.98's bundled rust-lld crash while linking
# the large integration-test binary on a two-core runner.
test_debug: 0
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "true"
add-job-id-key: "false"
- name: Build
run: cargo build --workspace --all-targets ${{ matrix.args }} --verbose
- name: Run tests
run: cargo test --workspace --all-targets ${{ matrix.args }} --verbose
env:
CARGO_PROFILE_TEST_DEBUG: ${{ matrix.test_debug }}
clippy_check:
name: Clippy (${{ matrix.name }})
runs-on: ubicloud-standard-2
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- name: default
args: ""
- name: all-features
args: "--all-features"
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "true"
add-job-id-key: "false"
- name: Clippy (deny warnings)
run: cargo clippy --workspace --all-targets ${{ matrix.args }} -- -D warnings
cell_lock_models:
name: Archived-row lock concurrency models
runs-on: ubicloud-standard-2
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --release --lib cell_lock_models
env:
RUSTFLAGS: --cfg wt_loom
CARGO_TARGET_DIR: target/cell-lock-loom
no_default_features:
name: Library without default features
runs-on: ubicloud-standard-2
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: sh scripts/check-no-std.sh -p worktable --lib --no-default-features
- run: sh scripts/check-no-std.sh --manifest-path tests/nostd-consumer/Cargo.toml
- run: cargo test --manifest-path tests/nostd-consumer/Cargo.toml
- run: rustup target add x86_64-pc-windows-gnu
- run: sh scripts/check-no-std.sh -p worktable --lib --no-default-features
env:
NO_STD_TARGET: x86_64-pc-windows-gnu
CARGO_TARGET_DIR: target/no-std-cross
- name: Portable search feature combinations
run: |
for search in wti-predictable-search wti-hybrid-search wti-std-search; do
sh scripts/check-no-std.sh -p worktable --lib --no-default-features --features "$search,logical-index-persistence,versioned-row-publication,runtime-backends"
done
- run: cargo clippy -p worktable --lib --no-default-features -- -D warnings
duplicate_index_crates:
name: One version of each shared index crate
runs-on: ubicloud-standard-2
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "true"
add-job-id-key: "false"
# Two versions of WorkTablesIndex in one graph split the type identity of
# `Pair` and `ChangeEvent`, and the build then fails with "expected
# ChangeEvent<Pair<T, Link>>, found a different ChangeEvent<Pair<T,
# Link>>" across dozens of unrelated-looking lines. It happens whenever
# data_bucket and worktable disagree about which version they want, which
# is every time one is bumped and released without the other.
#
# The caret requirements are correct and stay. This turns the mismatch
# into one named failure instead of a wall of trait errors, which is the
# guard WT-8 asked for.
- name: Refuse a duplicated WorkTablesIndex or data_bucket
run: |
duplicates=$(cargo tree --duplicates --edges normal 2>/dev/null \
| grep -E '^(WorkTablesIndex|data_bucket) v' | sort -u)
if [ -n "$duplicates" ]; then
echo "More than one version of a shared index crate is in the graph:"
echo "$duplicates"
echo
echo "WorkTablesIndex, data_bucket and worktable move as one train."
echo "Publish compatible releases in dependency order."
exit 1
fi
echo "one version of each: ok"
publish:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: [fmt, build, clippy_check, cell_lock_models, no_default_features, duplicate_index_crates]
runs-on: ubicloud-standard-2
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Publish when master carries a new version
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
set -euo pipefail
if [ -z "${CARGO_REGISTRY_TOKEN:-}" ]; then
echo "CARGO_REGISTRY_TOKEN is not set on this repository" >&2
exit 1
fi
# Publish in dependency order. worktable_codegen depends on
# worktable_dsl and worktable depends on worktable_codegen, both by
# path with a caret requirement, so each must be on the registry before
# the next is packaged. Omitting worktable_dsl here is what made
# `cargo publish -p worktable_codegen` fail with "no matching package
# named `worktable_dsl` found" the moment the DSL extraction landed.
manifest_version() {
cargo read-manifest --manifest-path "$1" | jq -er '.version'
}
is_published() {
cargo info --registry crates-io "$1@$2" >/dev/null 2>&1
}
wait_until_published() {
package=$1
version=$2
for _ in $(seq 1 60); do
if is_published "$package" "$version"; then
return 0
fi
sleep 5
done
echo "$package $version did not appear on crates.io in five minutes" >&2
return 1
}
publish_if_new() {
package="$1"
manifest="$2"
version=$(manifest_version "$manifest")
if is_published "$package" "$version"; then
echo "$package $version is already on crates.io; skipping"
return 0
fi
echo "publishing $package $version"
cargo publish -p "$package"
wait_until_published "$package" "$version"
}
publish_if_new worktable_dsl dsl/Cargo.toml
publish_if_new worktable_codegen codegen/Cargo.toml
publish_if_new worktable Cargo.toml