-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
34 lines (28 loc) · 934 Bytes
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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 }}