Skip to content

Fix cache issues with self-hosted runners #3879

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChrisRackauckas-Claude
Copy link

Summary

  • Adds conditional logic to disable julia-actions/cache for self-hosted runners
  • Self-hosted runners persist between runs, causing cache action to fail when depot already exists
  • Uses USE_SELF_HOSTED repository variable to detect when using self-hosted runners

Problem

As discussed in Slack, the caching fails on self-hosted runners because they don't clean slate between runs, so the depot already exists when the cache action tries to restore it.

Reference: https://github.com/SciML/ModelingToolkit.jl/actions/runs/16840335621/job/47712027510?pr=3869

Solution

Following Ian Butterworth's suggestion, this PR:

  1. Detects when using self-hosted runners via the USE_SELF_HOSTED repository variable
  2. Passes self-hosted: true to the reusable workflow when the variable is set
  3. Disables the cache action (cache: false) for self-hosted runners

Usage

To use self-hosted runners, set the USE_SELF_HOSTED repository variable to 'true' in the repository settings.

Test Plan

  • Verify CI passes with normal GitHub-hosted runners (cache enabled)
  • Test with USE_SELF_HOSTED='true' to verify self-hosted runners work without cache errors

🤖 Generated with Claude Code

Disable julia-actions/cache for self-hosted runners as they persist between runs,
which causes the cache action to fail when the depot already exists.

This change:
- Adds conditional logic to detect self-hosted runners via USE_SELF_HOSTED repository variable
- Passes self-hosted=true when USE_SELF_HOSTED is set
- Disables cache when running on self-hosted runners

To use self-hosted runners, set the USE_SELF_HOSTED repository variable to 'true'.

Fixes the issue discussed here: https://github.com/SciML/ModelingToolkit.jl/actions/runs/16840335621/job/47712027510

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants