@@ -33,6 +33,9 @@ outputs:
33
33
rustup-version :
34
34
description : " Version as reported by `rustup --version`"
35
35
value : ${{steps.versions.outputs.rustup-version}}
36
+ cachekey :
37
+ description : A short hash of the rustc version, appropriate for use as a cache key. "20220627a831"
38
+ value : ${{steps.versions.outputs.cachekey}}
36
39
37
40
runs :
38
41
using : composite
@@ -60,15 +63,20 @@ runs:
60
63
rustup toolchain install ${{inputs.toolchain}}${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal${{steps.flags.outputs.downgrade}} --no-self-update
61
64
rustup default ${{inputs.toolchain}}
62
65
shell : bash
66
+
63
67
- name : Print installed versions
64
68
id : versions
65
69
run : |
66
- echo "::set-output name=rustc-version::$(rustc --version)"
67
- rustc --version
68
- echo "::set-output name=cargo-version::$(cargo --version)"
69
- cargo --version
70
- echo "::set-output name=rustup-version::$(rustup --version)"
71
- rustup --version
70
+ echo "::set-output name=rustc-version::$(rustc +${{inputs.toolchain}} --version)"
71
+ rustc +${{inputs.toolchain}} --version --verbose
72
+ echo "::set-output name=cargo-version::$(cargo +${{inputs.toolchain}} --version)"
73
+ cargo +${{inputs.toolchain}} --version --verbose
74
+ echo "::set-output name=rustup-version::$(rustup +${{inputs.toolchain}} --version)"
75
+ rustup +${{inputs.toolchain}} --version
76
+
77
+ DATE=$(rustc +${{inputs.toolchain}} --version --verbose | sed -ne 's/^commit-date: \(20[0-9][0-9]\)-\([01][0-9]\)-\([0-3][0-9]\)$/\1\2\3/p')
78
+ HASH=$(rustc +${{inputs.toolchain}} --version --verbose | sed -ne 's/^commit-hash: //p')
79
+ echo "::set-output name=cachekey::$(echo $DATE$HASH | head -c12)"
72
80
shell : bash
73
81
74
82
- name : " Setup Rust Caching"
0 commit comments