LightAndLight / ipso

A functional scripting language.

Home Page:https://ipso.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub Actions cache isn't shared across branches

LightAndLight opened this issue · comments

I noticed a cache miss (https://github.com/LightAndLight/ipso/actions/runs/4098584146/jobs/7067800203#step:15:20) even though the cache key existed: github-actions-caches

I learned that caches aren't actually shared between branches: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache, so if a pull request creates a cache key, then a subsequent pull request can't access that key.

It seems that branches can access the cache keys of main, so this might mean I have to run the tests.yml workflow for main so that pull requests can use the cache properly:

on:
  push:
    branches:
      - main