-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add caching option #1
Comments
@CAMOBAP can you please help here? Thanks! |
This comment was marked as outdated.
This comment was marked as outdated.
there's another level of "dependency caching" that can be done sorta like how the setup-node project will cache node_modules. this is only relevant if the ~/.fontist folder is so huge that redownloading/creating it takes longer than restoring if from cache (which still involves a download; just from actions/cache not from the formulas repo or whatever) bun for example doesn't use a cache because downloading fresh is faster than fetching from cache oven-sh/setup-bun#14 (comment) other relevant discussion similar usecase typst-community/setup-typst#15 (comment) |
It looks relevant because fonts may be stored on third-party over the world and it's more about reliability them for speed |
another question to bring up is: what would be the cache key? there's a manifest.yml mentioned in https://www.fontist.org/docs/ that could be used like |
IMHO caching without prior #4 implementation will have not much sense (otherwise users can use So we can use font string to calculate @ronaldtse @jcbhmr make sense? |
that's not typically how things are used; see https://github.com/actions/setup-node and https://github.com/actions/setup-python for good examples. the idea is that you:
|
Good catch because caching happens on post-run action we still can do it with some hardcoded or user-defined key The question is: are potential users interested in calling fontist explicitly at all? As far as I understand the purpose of the action the goal is to install fonts. And users probably don't care how exactly installation will happen (correct me if I'm wrong) At this moment, it looks like we should provide all required input into the setup action to install all required fonts in one place i.e. |
To be more specific: the goal is to setup Fontist; specifically to install the Fontist CLI and (probably) run Typical use probably looks like: - uses: fontist/setup-fontist@v1
- run: fontist list "Fira Code" > report.txt
- run: node process-report.js report.txt
- run: fontist install "Consolas"
- run: fontist manifest-install manifest.yml
- run: typst paper.typ --font-path ~/.fontist/fonts
- run: cp ~/.fontist/fonts ./fonts && npm run build-web-app-with-fonts Notice how we just setup the Fontist environment and let the user do the installing and such. This is similar to how setup-node and setup-python leave the whole "how do you want to use this Node.js or Python installation?" up to the user completely. tl;dr: install and configure the cli but dont do anything over-the-top; let the user use the cli to do things instead of wrapping the cli in YAML config mess |
@jcbhmr see your point thanks, To me, it looks like we should not cache anything else except |
bringing things back around to caching, here's the three things i think COULD be cached:
the ruby installation is taken care of https://github.com/ruby/setup-ruby btw i was wrong about #6 solving the 2 "cache the |
P.S. just found that you already worked on it #6 ) |
Yep! It installs whatever Why not use the builtin system Ruby installation? Good point I didn't realize GitHub Actions runners came with Ruby preinstalled. I guess for Docker-based workflows like https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container that don't have Ruby installed? You're right we could drop the
I was under the impression that this ran For reference I just tried a blank repo with this workflow file: name: My workflow
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: gem install fontist and it DID NOT cache the gems: 😢
or did you mean install fontist using a ...only problem is that setup-ruby caches the ENTIRE /var/rubgeminstallfolder so this would include any user-installed dependencies as well. Unsure if you want that or how well that would work in an existing Ruby project. I'm not a Ruby expert. 🤷♀️
👍 |
OHHH i remember "why use setup-ruby" and isolate the ruby installation? because what if a user does this: - uses: ruby/setup-ruby@v1
with:
ruby-version: "2.x"
- uses: fontist/setup-fontist@v1 what happens now? should we use system ruby or install our own copy using another setup-ruby invocation? you could just say "psssh unsupported; get a good ruby version or else it just doesn't work 🤷♀️" lol which is probably the best thing to do honestly |
This action to setup Fontist takes around 1 minute.
We should add a
cache
option so that the setup is cached.The text was updated successfully, but these errors were encountered: