ff5b06d0c2
- Added composite GitHub actions to ensure rust toolchains and cargo helpers. - Added a kata-native build action with variant checks and platform artifact uploads. - Reworked CI matrices to split native cross-platform jobs and gate releases accordingly. - Updated runner bootstrap and image to preinstall pinned build tools for CI consistency.
39 lines
1.0 KiB
YAML
39 lines
1.0 KiB
YAML
name: "ensure cargo tool"
|
|
description: Ensure a cargo-installed CLI is present.
|
|
|
|
inputs:
|
|
binary:
|
|
required: true
|
|
description: Binary name expected on PATH
|
|
crate:
|
|
required: false
|
|
default: ""
|
|
description: Crate name to cargo install; defaults to the binary name
|
|
version:
|
|
required: false
|
|
default: ""
|
|
description: Optional crate version
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- shell: bash
|
|
env:
|
|
BINARY: ${{ inputs.binary }}
|
|
CRATE: ${{ inputs.crate }}
|
|
VERSION: ${{ inputs.version }}
|
|
run: |
|
|
set -euo pipefail
|
|
if command -v "$BINARY" >/dev/null 2>&1; then
|
|
echo "Using baked cargo tool: $BINARY"
|
|
exit 0
|
|
fi
|
|
|
|
crate="${CRATE:-$BINARY}"
|
|
install_args=(install --locked "$crate")
|
|
if [ -n "$VERSION" ]; then
|
|
install_args+=(--version "$VERSION")
|
|
fi
|
|
cargo "${install_args[@]}"
|
|
echo "Installed cargo tool: $BINARY"
|