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
19 changes: 19 additions & 0 deletions .github/workflows/mutation-cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ on:
"--all-features" so feature-gated tests run against mutants.
type: string
default: ""
setup-commands:
description: >-
Shell commands run in each mutants job before cargo-mutants
(e.g. installing a linker such as mold, or system packages
the build needs). Executed with bash under `set -euo
pipefail`; empty means no extra setup.
type: string
default: ""

# Default the token to no scopes; jobs opt in explicitly.
permissions: {}
Expand Down Expand Up @@ -185,6 +193,17 @@ jobs:
cargo binstall --no-confirm cargo-mutants
fi

- name: Run setup commands
if: ${{ inputs.setup-commands != '' }}
shell: bash
env:
SETUP_COMMANDS: ${{ inputs.setup-commands }}
run: |
set -euo pipefail
script="${RUNNER_TEMP}/mutation-setup-commands.sh"
printf '%s\n' "${SETUP_COMMANDS}" > "${script}"
bash -euo pipefail "${script}"

- name: Install uv (act)
if: ${{ env.ACT == 'true' }}
shell: bash
Expand Down
1 change: 1 addition & 0 deletions docs/mutation-cargo-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:
| `shard-count` | `6` | Fan-out for full dispatch runs (scoped runs stay single-shard). |
| `cargo-mutants-version` | pinned | Tool version; the summary parser is validated against it. |
| `extra-args` | (empty) | Extra cargo-mutants arguments (shell-lexed), e.g. `--all-features`. |
| `setup-commands` | (empty) | Shell commands run before cargo-mutants in each mutants job (e.g. `sudo apt-get install -y mold` when the repo's `.cargo/config.toml` selects that linker). |

## Notes

Expand Down
Loading