1716905469
This commit is contained in:
18
action.yml
18
action.yml
@ -158,3 +158,21 @@ runs:
|
||||
DATE=$(rustc --version --verbose | sed -ne 's/^commit-date: \(20[0-9][0-9]\)-\([01][0-9]\)-\([0-3][0-9]\)$/\1\2\3/p')
|
||||
HASH=$(rustc --version --verbose | sed -ne 's/^commit-hash: //p')
|
||||
echo "cachekey=$(echo $DATE$HASH | head -c12)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Downgrade registry access protocol when needed
|
||||
shell: bash
|
||||
run: |
|
||||
# Not all versions support setting CARGO_REGISTRIES_CRATES_IO_PROTOCOL
|
||||
# On versions 1.66, 1.67, and 1.68.0-nightly the value "sparse" is still unstable.
|
||||
# https://github.com/dtolnay/rust-toolchain/pull/69#discussion_r1107268108
|
||||
# If we detect an incompatible value, set it to "git" which is always supported.
|
||||
if [[ "${{steps.versions.outputs.rustc-version}}" =~ ^rustc\ (1\.6[67]\.|1\.68\.0-nightly) && "${CARGO_REGISTRIES_CRATES_IO_PROTOCOL}" == "sparse" ]]; then
|
||||
echo "Downgrade cargo registry protocol to git"
|
||||
echo "CARGO_REGISTRIES_CRATES_IO_PROTOCOL=git" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Setup Rust Caching
|
||||
if: inputs.cache == 'true'
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: ${{inputs.cache-workspaces}}
|
||||
|
Reference in New Issue
Block a user