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

Cache gem install fontist, cache ~/.fontist, and add semver support #6

Merged
merged 37 commits into from
Jan 30, 2024
Merged

Cache gem install fontist, cache ~/.fontist, and add semver support #6

merged 37 commits into from
Jan 30, 2024

Conversation

jcbhmr
Copy link
Collaborator

@jcbhmr jcbhmr commented Jan 26, 2024

This PR would:

  1. use javascript instead of composite
  2. use bun to bundle the code into a single file (dependencies included)
  3. update github actions to have a build step upon releases
  4. STILL REQUIRE THAT A GOOD VERSION OF RUBY IS USED see Isolate Ruby installation from system ruby version #5 -- idea to have own Ruby install location was abandoned; can be revisisted -- its not that hard to do now that i did it once
  5. first check $RUNNER_TOOL_CACHE for fontist
  6. if cache: true and if no tool cache, try to restore from workflow cache
  7. if still no fontist, resort to gem install fontist with custom --install-dir to avoid contaminating user's rubygems install location
  8. create wrapper fontist and fontist.cmd scripts which proxy to the --install-dir location with some magic env vars set to load the library .rb files from the --install-dir instead of the global default spot
  9. if cache: true and no cache content then try to stash in cache
  10. hashFiles() of manifest.yml or manifest.yaml in the root folder. this is overridable by the user via cache-dependency-path just like setup-node
  11. use hashFiles() as part of the cache key to try and restore ~/.fontist from cache; can fail if no current cache (which is OK)
  12. run fontist update to refresh any outdated cache stuffs
  13. POST RUN: save current filled ~/.fontist to cache with hashFiles() cach key from before; can fail if cache already exists (which is OK)

fix #9
fix #8
fix #7
fix #1
basically does a good amount of caching and adds semver version support

@jcbhmr

This comment was marked as outdated.

@jcbhmr jcbhmr marked this pull request as ready for review January 26, 2024 21:36
@jcbhmr jcbhmr mentioned this pull request Jan 26, 2024
@jcbhmr

This comment was marked as outdated.

@jcbhmr

This comment was marked as outdated.

@jcbhmr jcbhmr marked this pull request as draft January 26, 2024 22:24
@jcbhmr jcbhmr changed the title Isolate Ruby version from system & cache gem install fontist Cache gem install fontist & cache ~/.fontist Jan 27, 2024
@jcbhmr jcbhmr changed the title Cache gem install fontist & cache ~/.fontist Cache gem install fontist Jan 27, 2024
@jcbhmr jcbhmr changed the title Cache gem install fontist Cache gem install fontist & cache ~/.fontist Jan 27, 2024
@jcbhmr jcbhmr marked this pull request as ready for review January 27, 2024 02:28
@jcbhmr jcbhmr marked this pull request as draft January 27, 2024 02:51
@jcbhmr jcbhmr marked this pull request as ready for review January 27, 2024 18:49
@jcbhmr jcbhmr self-assigned this Jan 27, 2024
@jcbhmr
Copy link
Collaborator Author

jcbhmr commented Jan 27, 2024

i think the logic and results look good but id like someone else to review this ❤️

image

(yes this pr has changed names and purposes like 5 times lol 😆 )

@jcbhmr jcbhmr changed the title Cache gem install fontist & cache ~/.fontist Cache gem install fontist, cache ~/.fontist, and add semver support Jan 27, 2024
@ronaldtse
Copy link
Contributor

Thank you @jcbhmr for this!

@CAMOBAP @alexeymorozov could you please help review and merge this? Thanks!

@@ -23,9 +23,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
# os: [ubuntu-latest, macos-latest, windows-latest]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there some issues on Windows discovered?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because bun is not supported on Windows.

README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
Copy link

@CAMOBAP CAMOBAP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Job!

Few minor comments added

@ronaldtse ronaldtse merged commit 5922aae into fontist:main Jan 30, 2024
2 checks passed
@ronaldtse
Copy link
Contributor

Thank you @jcbhmr !

@ronaldtse
Copy link
Contributor

@CAMOBAP we can probably start using this action for our Metanorma actions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants