-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
70 lines (55 loc) · 2.98 KB
/
Copy pathJustfile
File metadata and controls
70 lines (55 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
set shell := ["bash", "-euo", "pipefail", "-c"]
# Run the complete local contract gates (release/container are separate).
default: all
all: _all-inputs fmt clippy turso postgres sdk-postgres sdk-turso sdk-schema
[private]
_all-inputs:
: "${SQLREST_TEST_POSTGRES:?Set a disposable PostgreSQL URL for core contracts}"
: "${SQLREST_EXAMPLES_POSTGRES:?Set a DIFFERENT empty PostgreSQL database URL for examples}"
: "${OPENAPI_NEXUS_BIN:?Set the pinned openapi-nexus binary path}"
test "$SQLREST_TEST_POSTGRES" != "$SQLREST_EXAMPLES_POSTGRES" || { echo "Core and example database URLs must be different" >&2; exit 2; }
# Check Rust formatting and whitespace.
fmt:
just --fmt --check
cargo fmt --check
git diff --check
clippy:
cargo clippy --locked --all-targets -- -D warnings
# Includes backend-neutral contracts, doctests and real Turso.
turso:
cargo test --locked
# Never run blanket --ignored: restart_worker is a subprocess fixture and
# the old upstream high-level Turso CPU timeout probe is intentionally skipped.
postgres:
: "${SQLREST_TEST_POSTGRES:?Set a disposable PostgreSQL URL for core contracts}"
cargo test --locked --lib postgres_tests:: -- --ignored
cargo test --locked --test migration_contract postgres_ -- --ignored
cargo test --locked --test postgres_contract --test execution_contract --test commit_contract --test registry_postgres -- --ignored
cargo test --locked --test http_contract postgres_http_lifecycle -- --ignored
sdk-turso:
: "${OPENAPI_NEXUS_BIN:?Set the pinned openapi-nexus binary path}"
cargo test --locked --test examples_contract generated_sdks_call_real_examples -- --ignored
sdk-postgres:
: "${SQLREST_EXAMPLES_POSTGRES:?Set an empty disposable PostgreSQL database URL for examples}"
: "${OPENAPI_NEXUS_BIN:?Set the pinned openapi-nexus binary path}"
SQLREST_TEST_POSTGRES="$SQLREST_EXAMPLES_POSTGRES" cargo test --locked --test examples_contract postgres_examples_and_process_restart -- --ignored
sdk-schema:
: "${OPENAPI_NEXUS_BIN:?Set the pinned openapi-nexus binary path}"
cargo test --locked --test sdk_contract -- --ignored
release:
cargo build --release --locked
# Verify the actual crate archive without uploading anything.
publish-dry-run:
cargo publish --locked --registry crates-io --dry-run
# Upload the current crate to crates.io. Does not create or push Git tags.
publish:
cargo publish --locked --registry crates-io
# Package an existing release binary and exercise its container lifecycle.
container:
docker build --tag sqlrest:ci .
python3 scripts/e2e.py --image sqlrest:ci
# Download the pinned Linux x86_64 musl binary; never build the generator.
download-openapi-nexus destination:
mkdir -p -- {{ quote(destination) }}
curl -fsSL https://github.com/rust-codegen-group/openapi-nexus/releases/download/0.2.3/openapi-nexus-x86_64-unknown-linux-musl.tar.xz | tar -xJ --strip-components=1 -C {{ quote(destination) }}
{{ quote(destination + "/openapi-nexus") }} --version