Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider a different $RUNNER_TOOL_CACHE than the default as a self-hosted runner and add self-hosted input #474

Merged
merged 3 commits into from
Mar 3, 2023

Conversation

eregon
Copy link
Member

@eregon eregon commented Mar 3, 2023

Fixes #242

…lf-hosted

* Since checking for self-hosted is based on guessing as there is
  no proper predicate for it in GitHub Actions (AFAIK).
@eregon eregon force-pushed the consider-different-toolcache-self-hosted branch from a759efe to d08d24c Compare March 3, 2023 16:35
@eregon
Copy link
Member Author

eregon commented Mar 3, 2023

On the deprecated and no longer supported ubuntu-18.04 it looks like:
https://github.com/eregon/setup-ruby-test/actions/runs/4325551205/jobs/7551857499

Error: The current runner (ubuntu-18.04-x64, RUNNER_TOOL_CACHE=/opt/hostedtoolcache) was detected as self-hosted because the platform does not match a GitHub-hosted runner image (or that image is deprecated and no longer supported).
In such a case, you should install Ruby in the $RUNNER_TOOL_CACHE yourself, for example using https://github.com/rbenv/ruby-build
You can take inspiration from this workflow for more details: https://github.com/ruby/ruby-builder/blob/master/.github/workflows/build.yml
$ ruby-build 3.2.1 /opt/hostedtoolcache/Ruby/3.2.1/x64
Once that completes successfully, mark it as complete with:
$ touch /opt/hostedtoolcache/Ruby/3.2.1/x64.complete
It is your responsibility to ensure installing Ruby like that is not done in parallel.

@eregon eregon merged commit 5a73aa9 into ruby:master Mar 3, 2023
@eregon eregon deleted the consider-different-toolcache-self-hosted branch March 3, 2023 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Tool cache path on self-hosted runners can't be hardcoded
1 participant