Skip to content

Commit 95875a4

Browse files
committed
fix(action): default to cargo-rail 0.13.0
1 parent 3e8d7bc commit 95875a4

7 files changed

Lines changed: 102 additions & 35 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Debug mode adds:
5353

5454
| Input | Default | Description |
5555
|---|---|---|
56-
| `version` | `0.12.0` | Published `cargo-rail` release to install |
56+
| `version` | `0.13.0` | Published `cargo-rail` release to install |
5757
| `checksum` | `required` | `required`, `if-available`, or `off` |
5858
| `since` | auto | Git ref for planner comparison |
5959
| `args` | `""` | Extra planner args except format/output flags |

action.yaml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ branding:
88

99
inputs:
1010
version:
11-
description: "cargo-rail version to install (default: 0.12.0; use 'latest' for floating installs)"
11+
description: "cargo-rail version to install (default: 0.13.0; use 'latest' for
12+
floating installs)"
1213
required: false
13-
default: "0.12.0"
14+
default: "0.13.0"
1415

1516
checksum:
16-
description: "Checksum verification mode for downloaded binaries: required/if-available/off"
17+
description: "Checksum verification mode for downloaded binaries:
18+
required/if-available/off"
1719
required: false
1820
default: "required"
1921

@@ -151,7 +153,7 @@ runs:
151153
shasum -a 256 "$file" | awk '{print $1}'
152154
153155
else
154-
156+
155157
if command -v python3 &>/dev/null; then
156158
python3 -c 'import hashlib,sys; p=sys.argv[1]; h=hashlib.sha256(); f=open(p,"rb"); [h.update(b) for b in iter(lambda: f.read(1024*1024), b"")]; f.close(); print(h.hexdigest())' "$file"
157159
elif command -v python &>/dev/null; then
@@ -167,7 +169,7 @@ runs:
167169
local archive_path="$1"
168170
local archive_name="$2"
169171
local mode="${CHECKSUM_MODE:-required}"
170-
172+
171173
case "$mode" in
172174
off)
173175
echo "Checksum verification disabled (checksum=off)"
@@ -180,10 +182,10 @@ runs:
180182
exit 1
181183
;;
182184
esac
183-
185+
184186
local sums_url="https://github.com/loadingalias/cargo-rail/releases/download/v${VERSION}/SHA256SUMS"
185187
local sums_path="/tmp/SHA256SUMS-cargo-rail"
186-
188+
187189
if ! curl -fsSL --retry 3 "$sums_url" -o "$sums_path" 2>/dev/null; then
188190
if [[ "$mode" == "required" ]]; then
189191
echo "::error::SHA256SUMS not found for v$VERSION; set checksum: if-available or off to skip verification"
@@ -192,21 +194,21 @@ runs:
192194
echo "::warning::SHA256SUMS not found for v$VERSION; skipping checksum verification"
193195
return 0
194196
fi
195-
197+
196198
local expected
197199
expected="$(awk -v f="$archive_name" '$2==f || $2=="*"f {print $1; exit}' "$sums_path" 2>/dev/null || true)"
198200
if [[ -z "$expected" ]]; then
199201
echo "::error::SHA256SUMS is present for v$VERSION but has no entry for $archive_name"
200202
exit 1
201203
fi
202-
204+
203205
local actual
204206
actual="$(calc_sha256 "$archive_path")"
205207
if [[ "$actual" != "$expected" ]]; then
206208
echo "::error::Checksum mismatch for $archive_name (expected $expected, got $actual)"
207209
exit 1
208210
fi
209-
211+
210212
echo "Checksum verified for $archive_name"
211213
}
212214

tests/fixtures/plan_docs_only.json

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,38 @@
4040
"toolchain_fingerprint": "none"
4141
},
4242
"surfaces": {
43-
"bench": {"enabled": false, "reasons": []},
44-
"build": {"enabled": false, "reasons": []},
45-
"docs": {"enabled": true, "reasons": [1]},
46-
"infra": {"enabled": false, "reasons": []},
47-
"test": {"enabled": false, "reasons": []}
43+
"bench": {
44+
"enabled": false,
45+
"reasons": []
46+
},
47+
"build": {
48+
"enabled": false,
49+
"reasons": []
50+
},
51+
"docs": {
52+
"enabled": true,
53+
"reasons": [
54+
1
55+
]
56+
},
57+
"infra": {
58+
"enabled": false,
59+
"reasons": []
60+
},
61+
"test": {
62+
"enabled": false,
63+
"reasons": []
64+
}
4865
},
4966
"trace": [
50-
{"id": 1, "code": "FILE_KIND_DOCS", "file": "README.md", "surface": "docs"}
67+
{
68+
"id": 1,
69+
"code": "FILE_KIND_DOCS",
70+
"file": "README.md",
71+
"surface": "docs"
72+
}
5173
],
5274
"reproducibility": {
53-
"cargo_rail_version": "0.12.0"
75+
"cargo_rail_version": "0.13.0"
5476
}
5577
}

tests/fixtures/plan_rust_src.json

Lines changed: 55 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@
55
"path": "crates/lib-a/src/lib.rs",
66
"kind": "rust",
77
"sub_kind": "src",
8-
"owners": ["lib-a"],
8+
"owners": [
9+
"lib-a"
10+
],
911
"owner_scope": "crate"
1012
}
1113
],
1214
"impact": {
13-
"direct_crates": ["lib-a"],
14-
"transitive_crates": ["lib-b"]
15+
"direct_crates": [
16+
"lib-a"
17+
],
18+
"transitive_crates": [
19+
"lib-b"
20+
]
1521
},
1622
"scope": {
1723
"scope_contract_version": 1,
@@ -41,18 +47,55 @@
4147
"toolchain_fingerprint": "<TOOLCHAIN_FP>"
4248
},
4349
"surfaces": {
44-
"bench": {"enabled": false, "reasons": []},
45-
"build": {"enabled": true, "reasons": [2, 3]},
46-
"docs": {"enabled": false, "reasons": []},
47-
"infra": {"enabled": false, "reasons": []},
48-
"test": {"enabled": true, "reasons": [2, 3]}
50+
"bench": {
51+
"enabled": false,
52+
"reasons": []
53+
},
54+
"build": {
55+
"enabled": true,
56+
"reasons": [
57+
2,
58+
3
59+
]
60+
},
61+
"docs": {
62+
"enabled": false,
63+
"reasons": []
64+
},
65+
"infra": {
66+
"enabled": false,
67+
"reasons": []
68+
},
69+
"test": {
70+
"enabled": true,
71+
"reasons": [
72+
2,
73+
3
74+
]
75+
}
4976
},
5077
"trace": [
51-
{"id": 1, "code": "FILE_OWNS_CRATE_DIRECT", "file": "crates/lib-a/src/lib.rs", "crate": "lib-a"},
52-
{"id": 2, "code": "FILE_KIND_RUST_SRC", "file": "crates/lib-a/src/lib.rs", "surface": "build"},
53-
{"id": 3, "code": "TRANSITIVE_DEPENDS_ON_DIRECT", "crate": "lib-b", "depends_on": "lib-a", "surface": "build"}
78+
{
79+
"id": 1,
80+
"code": "FILE_OWNS_CRATE_DIRECT",
81+
"file": "crates/lib-a/src/lib.rs",
82+
"crate": "lib-a"
83+
},
84+
{
85+
"id": 2,
86+
"code": "FILE_KIND_RUST_SRC",
87+
"file": "crates/lib-a/src/lib.rs",
88+
"surface": "build"
89+
},
90+
{
91+
"id": 3,
92+
"code": "TRANSITIVE_DEPENDS_ON_DIRECT",
93+
"crate": "lib-b",
94+
"depends_on": "lib-a",
95+
"surface": "build"
96+
}
5497
],
5598
"reproducibility": {
56-
"cargo_rail_version": "0.12.0"
99+
"cargo_rail_version": "0.13.0"
57100
}
58101
}

tests/golden/summary_docs_only.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
| | |
44
|---|---|
5-
| **Version** | `0.12.0` |
5+
| **Version** | `0.13.0` |
66
| **Install** | Binary download |
77
| **Base** | `origin/main` |
88
| **Changed files** | 1 |

tests/golden/summary_rust_src.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
| | |
44
|---|---|
5-
| **Version** | `0.12.0` |
5+
| **Version** | `0.13.0` |
66
| **Install** | Binary download |
77
| **Base** | `origin/main` |
88
| **Changed files** | 1 |

tests/test_summary.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ run_summary() {
1111
python3 "$ROOT/scripts/render_summary.py" \
1212
--plan-json-file "$fixture" \
1313
--install-method binary \
14-
--install-version 0.12.0 \
15-
--base-ref origin/main > "$out"
14+
--install-version 0.13.0 \
15+
--base-ref origin/main >"$out"
1616
}
1717

1818
# Determinism: same fixture => byte-identical summary output.
@@ -27,7 +27,7 @@ diff -u "$ROOT/tests/golden/summary_rust_src.md" "$TMP_DIR/summary_rust_src.md"
2727
run_summary "$ROOT/tests/fixtures/plan_docs_only.json" "$TMP_DIR/summary_docs_only.md"
2828
diff -u "$ROOT/tests/golden/summary_docs_only.md" "$TMP_DIR/summary_docs_only.md"
2929

30-
python3 - <<'PY' > "$TMP_DIR/plan_large.json"
30+
python3 - <<'PY' >"$TMP_DIR/plan_large.json"
3131
import json
3232
3333
trace = []

0 commit comments

Comments
 (0)