mirror of
https://github.com/actions-rust-lang/msrv.git
synced 2025-12-27 01:43:48 -05:00
35 lines
934 B
YAML
35 lines
934 B
YAML
name: Determine minimum supported Rust version (MSRV) for workspace
|
|
|
|
description: |
|
|
Determine minimum supported Rust version (MSRV) for workspace for use in a job matrix.
|
|
|
|
branding:
|
|
icon: info
|
|
color: orange
|
|
|
|
inputs:
|
|
manifest-path:
|
|
description: Path to Cargo.toml manifest for workspace
|
|
required: false
|
|
|
|
runs:
|
|
using: composite
|
|
|
|
steps:
|
|
- name: Read MSRV from workspace manifest
|
|
id: read_msrv
|
|
shell: bash
|
|
run: |
|
|
cargo metadata --format-version=1 --manifest-path=${{ inputs.manifest-path || 'Cargo.toml' }} \
|
|
| jq -r 'first(.packages[] | select(.source == null and .rust_version)) | .rust_version' \
|
|
| sed -E 's/^1\.([0-9]{2})$/1\.\1\.0/' \
|
|
| xargs -0 printf "msrv=%s" \
|
|
| tee /dev/stderr \
|
|
>> "$GITHUB_OUTPUT"
|
|
|
|
outputs:
|
|
msrv:
|
|
description: |-
|
|
Minimum supported Rust version. E.g.: 1.72.1"
|
|
value: ${{ steps.read_msrv.outputs.msrv }}
|