moonrepo / setup-rust

A maintained GitHub action for setting up Rust and Cargo.
100 stars 9 forks source link

403 errors in macOS runners causing long delays #22

Open thedjinn opened 3 months ago

thedjinn commented 3 months ago

We have been using setup-rust for a while on both Linux and macOS runners. On Linux everything is stable, but the macOS runners very often hang for long periods of time with the following error:

INFO has_release_artifact{release=GhRelease { repo: GhRepo { owner: "matthiaskrgr", repo: "cargo-cache" }, tag: "0.8.3" } artifact_name="cargo-cache-aarch64-apple-darwin-v0.8.3.tar"}:do_send_request{request=Request { method: GET, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api.github.com")), port: None, path: "/repos/matthiaskrgr/cargo-cache/releases/tags/0.8.3", query: None, fragment: None }, headers: {"accept": "application/vnd.github+json", "x-github-api-version": "2022-11-28"} } url=[https://api.github.com/repos/matthiaskrgr/cargo-cache/releases/tags/0.8.3}:](https://api.github.com/repos/matthiaskrgr/cargo-cache/releases/tags/0.8.3%7D:) Received status code 403 Forbidden, will wait for 120s and retry

After many attempts the step proceeds and emits the following warning:

WARN The package cargo-cache v0.8.3 (aarch64-apple-darwin) has been downloaded from third-party source QuickInstall

The entire action takes 25 minutes to run, making CI very slow for our project.

On both platforms the following step is used:

- uses: moonrepo/setup-rust@v1
  with:
      components: clippy
      cache-base: staging

We are using stock GitHub action runners, nothing special in our setup.

milesj commented 3 months ago

@thedjinn This happens because you're being rate limited by GH's API. You can resolve it by simply setting GITHUB_TOKEN: https://github.com/moonrepo/proto/blob/master/.github/workflows/ci.yml#L13