Skip to content

Javascript version of existing action which also saves if job fails#190

Closed
jkrumbiegel wants to merge 22 commits intojulia-actions:mainfrom
jkrumbiegel:jk/javascript-version-with-always-save
Closed

Javascript version of existing action which also saves if job fails#190
jkrumbiegel wants to merge 22 commits intojulia-actions:mainfrom
jkrumbiegel:jk/javascript-version-with-always-save

Conversation

@jkrumbiegel
Copy link
Copy Markdown
Contributor

The @actions/cache action does not save the cache if the job fails. This means that precompilation caches are lost if tests fail, a very common scenario when developing Julia packages. The cache action can be replaced by the cache save and cache restore steps, where the save step could in theory be called in a post step. But composite actions don't allow specifying post steps. In addition, the pytooling action which is currently used to schedule custom post actions works with command line tools, but not @actions/cache, so the default save functionality can't easily be used.

I decided that because the app logic itself wasn't that complicated, a translation to a javascript app with Claude could be a good idea and this is the result of that. I kept the .jl file with cache deletion logic intact to introduce as few actual code changes as possible. The jq dependency seems to have gone away too through the javascript use.

A drawback of the current test setup is that I need failing jobs to test these options, however failing jobs also make the CI summary look like it failed. There's no github actions option to allow a job failure in the sense of a green tick mark. So I just prefixed the names with "EXPECTED TO FAIL" hoping that it's still reasonably clear what's going on. In that sense, this problem is more of a cosmetic nature.

I set the new default to save-always: true as I think everyone would benefit from that. Due to the architecture and defaults change, a major version bump would probably be appropriate.

@jkrumbiegel
Copy link
Copy Markdown
Contributor Author

Yes but this requires more setup complexity, I'd bet most repos don't use that technique. I even don't for most of my own repos just because it's not the default.

@jkrumbiegel
Copy link
Copy Markdown
Contributor Author

jkrumbiegel commented Jan 9, 2026

@IanButterworth, continuing the conversation from Slack. I fixed some minor problems the Claude review highlighted. I think the question if the job status is checked at the right time should be answered yes, as the tests check that the cache is written or not written on job failure given the save-always flag.

I can't find a way to avoid the failing job markers which mark CI red overall, I think this just has to be accepted for an action like this which does some sort of "meta testing". But it won't affect the user experience at all.

Copy link
Copy Markdown
Contributor

@penelopeysm penelopeysm left a comment

Choose a reason for hiding this comment

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

The JavaScript all looks sensible -- although I have very little experience with Node (my JS is mostly frontend) so I just assume that all the libraries are doing what they should be doing :)

Comment on lines +389 to +390
using Pkg
Pkg.add(PackageSpec(name="DataFrames", version="1.6"))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a reason why DataFrames here? I always had the impression it's quite a big package, so maybe feels a bit excessive for testing CI

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will check, this was all very much Claude and little me, so I might have missed some small weirdnesses like that

Comment on lines +391 to +392
- name: Force failure to test no-save-on-failure
run: exit 1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Possibly change this one too, if you agree with the above.

jkrumbiegel and others added 4 commits January 31, 2026 12:54
Co-authored-by: Penelope Yong <[email protected]>
Co-authored-by: Penelope Yong <[email protected]>
Co-authored-by: Penelope Yong <[email protected]>
@IanButterworth
Copy link
Copy Markdown
Member

Merged in #198 Thanks!

@IanButterworth
Copy link
Copy Markdown
Member

Out in v3.0.0

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.

4 participants