@@ -33,6 +33,9 @@ outputs:
3333 rustup-version :
3434 description : " Version as reported by `rustup --version`"
3535 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}}
3639
3740runs :
3841 using : composite
@@ -60,15 +63,20 @@ runs:
6063 rustup toolchain install ${{inputs.toolchain}}${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal${{steps.flags.outputs.downgrade}} --no-self-update
6164 rustup default ${{inputs.toolchain}}
6265 shell : bash
66+
6367 - name : Print installed versions
6468 id : versions
6569 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)"
7280 shell : bash
7381
7482 - name : " Setup Rust Caching"
0 commit comments