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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# The standard Rust tasks every ctl repository runs. A repository includes
# this file at a pinned ctl-core release, after any other includes:
#
# [settings]
# experimental = true # mise loads git:: task includes only with this on
#
# [task_config]
# includes = [
# "git::https://github.com/victor-software-house/ctl-core.git//tasks/rust.toml?ref=v0.6.14",
# ]
#
# The repository defines `check:features` and `check:repo` itself; `verify`
# depends on both. `check:repo` holds the repository's own checks, and does
# nothing in a repository that has none.
# `check:versions` and `semver` run verctl through its served `ver` task, so
# a repository that declares releases in `.ctl/ver.yaml` includes that task
# at a pinned verctl release in the environment verify runs in, and locks
# verctl there. Without that file, `check:versions` passes with nothing to
# compare. In CI the verify step
# sets GITHUB_TOKEN with `pull-requests: read`: when a manifest version
# differs, the check reads the pull request to tell a Version PR apart.
# Every task that resolves dependencies passes --locked, so a Cargo.lock that
# no longer matches Cargo.toml fails verify here, as it fails a release build
# that passes --locked. A repository's own cargo commands, such as those in
# check:features, pass it too.
# Its mise.toml pins the tools these tasks call, including the stable
# compiler and the formatting nightly named in `format`. Bump the ref and
# those pins together.
[]
= "mise.toml, rust-toolchain.toml, and rust-version pin the same stable"
# pipefail: a failing cargo metadata or jq must fail the task, not pass it.
= "bash -o pipefail -c"
= [
'[ "$(rustc -V)" = "$(env -u RUSTUP_TOOLCHAIN RUSTUP_AUTO_INSTALL=0 rustc -V)" ] || { echo "✘ mise.toml and rust-toolchain.toml pin different toolchains"; exit 1; }',
'''cargo metadata --no-deps --locked --format-version 1 | jq --arg v "$(rustc -V | cut -d' ' -f2)" '[.packages[] | select(.rust_version != $v) | .name] | if length > 0 then error("✘ rust-version differs from the pinned stable in: \(join(", "))") else empty end' ''',
]
[]
= "rustfmt check on the formatting nightly"
= "cargo +nightly-2026-09-29 fmt --all -- --check"
[]
= "clippy -D warnings"
# --workspace in lint, test, and test:doc: without it cargo selects the
# default members, which is only the root package of a workspace with one, or
# the default-members list, so the other members would go unchecked.
= "cargo clippy --locked --workspace --all-targets --all-features -- -D warnings"
[]
= "Unit and integration tests"
# --tests selects every target whose `test` flag is on, bins included. --bins
# would select every bin regardless of the flag, so a fuzz target with
# `test = false` would build and run as a test.
= "cargo test --locked --workspace --all-features --lib --tests"
# Stops a hung test run instead of holding the gate. The limit also counts
# compile time and waits on the target/ lock, so it sits far above a cold build.
= "30m"
[]
= "Doc-tests"
= "cargo test --locked --workspace --doc --all-features"
= "30m"
[]
= "License, ban, and source policy (offline)"
= "cargo deny --locked check licenses bans sources"
[]
= "RustSec advisories and yanked crates (network)"
= "cargo deny --locked check advisories"
[]
= "Unused crate analysis"
# cargo-machete calls cargo metadata without --locked, which would rewrite a
# stale Cargo.lock while sibling tasks run. The locked metadata call fails
# first, so no task in verify ever writes the lock.
= [
"cargo metadata --locked --format-version 1 > /dev/null",
"cargo-machete --with-metadata",
]
# Published crates only. CI runs it before packaging; it compares against the
# release on crates.io, at the release type the pending fragments allow, so a
# break fails unless a fragment already bumps the minor.
[]
= "Public API changes against the last release (network)"
= "mise run ver semver"
# A manifest version changes only on the Version PR, through a fragment.
# The release config is what declares releases, so a repository without one
# has no version to compare, and needs neither the `ver` task nor verctl.
[]
= "Manifest versions match the default branch outside a Version PR"
= '''
config="${VERCTL_CONFIG:-.ctl/ver.yaml}"
if [ ! -f "$config" ]; then
echo "no $config: this repository declares no releases, nothing to compare"
exit 0
fi
mise run ver check --versions
'''
[]
= "Toolchain pins, format, lint, feature sets, tests, doc-tests, deny, unused crates, versions, repository checks"
= [
"check:toolchain", "format", "lint", "check:features",
"test", "test:doc", "deny", "deps", "check:versions", "check:repo",
]