Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/bloat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ permissions: {}

env:
CARGO_TERM_COLOR: always
# Keep debug info for cargo-bloat function name resolution
CARGO_PROFILE_RELEASE_STRIP: "none"
CARGO_PROFILE_RELEASE_DEBUG: "2"

jobs:
cli-bloat:
name: CLI size analysis
runs-on: ubuntu-latest
timeout-minutes: 20
# Keep debug info only for cargo-bloat function name resolution. The
# shipped-binary job uses the stripped production release profile.
env:
CARGO_PROFILE_RELEASE_STRIP: "none"
CARGO_PROFILE_RELEASE_DEBUG: "2"
permissions:
contents: read
outputs:
Expand Down
4 changes: 4 additions & 0 deletions scripts/workflow-policy.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,16 @@ test("workflow block parser rejects missing keys", () => {

test("binary-size workflow isolates incompatible release builds", () => {
const workflow = readWorkflow(".github/workflows/bloat.yml");
const globalEnv = indentedBlock(workflow, "env", 0);
const cliJob = indentedBlock(workflow, "cli-bloat", 2);
const shippedJob = indentedBlock(workflow, "shipped-binaries", 2);
const aggregateJob = indentedBlock(workflow, "bloat", 2);

assert.match(cliJob, /cargo bloat --release -p fallow-cli/);
assert.match(cliJob, /CARGO_PROFILE_RELEASE_STRIP: "none"/);
assert.match(cliJob, /CARGO_PROFILE_RELEASE_DEBUG: "2"/);
assert.doesNotMatch(cliJob, /fallow-lsp|fallow-mcp|fallow-multicall/);
assert.doesNotMatch(globalEnv, /CARGO_PROFILE_RELEASE_(STRIP|DEBUG)/);
assert.match(shippedJob, /cargo build --release -p fallow-lsp -p fallow-mcp -p fallow-multicall/);
assert.doesNotMatch(shippedJob, /cargo bloat/);
assert.match(aggregateJob, /needs:\n\s+- cli-bloat\n\s+- shipped-binaries/);
Expand Down
Loading