当 运行 in GitHub Actions 时,Cargo 无法下载依赖项

Cargo fails to download dependencies when running in GitHub Actions

cargo check 运行 在 GitHub 操作中时,它会下载大部分依赖项,但偶尔会在其中一个上失败。它在每个 运行 上都失败了(我测试了大约 5 次)。

下载依赖项在本地有效。

  Downloaded sys-info v0.5.10
  Downloaded strum_macros v0.19.4
  Downloaded proc-macro-error v1.0.4
  Downloaded pin-utils v0.1.0
  Downloaded v_escape v0.15.0
  Downloaded uuid v0.7.4
  Downloaded typeable v0.1.2
  Downloaded syn v1.0.73
  Downloaded strum v0.20.0
error: failed to download from `https://crates.io/api/v1/crates/rustc-demangle/0.1.20/download`
Error: failed to download from `https://crates.io/api/v1/crates/rustc-demangle/0.1.20/download`
Caused by:
  [55] Failed sending data to the peer (Connection died, tried 5 times before giving up)
Error: The process '/usr/share/rust/.cargo/bin/cargo' failed with exit code 101

这是什么原因造成的?

似乎是 nightly 工具链的问题。
toochain: nightly 更改为 toolchain: nightly-2021-07-05 在 ci 文件中解决了它:

uses: actions-rs/toolchain@v1
with:
  profile: minimal
  toolchain: nightly-2021-07-05
  override: true
  components: rustfmt