-
Notifications
You must be signed in to change notification settings - Fork 14
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
Use GitHubActionsLogger when building docs #16
Conversation
bump |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if using the global env is ideal either. Using the GHA logger seems like a sensible default to me, I'd say we can add an opt out if someone complains? :D
Yeah-- I think probably the global env is better than messing with the users local environment, though maybe we could do something like make a new environment in a tempdir, install the logger there, and then put that env in the |
Sounds good to me though I don't know pkg workflows like that well enough to understand if there are any potential side effects. |
Should we merge this as is or switch to the temporary env like you suggested? I'm happy with either |
I was thinking about that too— I think merging is fairly safe in that it’s unlikely folks are using the global env in a way in other steps of their job that will clash with us installing the low-dependency GitHubActions.jl, and that the fancier solution (temp env pushed into the load path) has the risk of bugs since it is more complex and I understand it less. However I’m pretty sure it’s the more “correct” approach in that it’s more isolated. so… I’m in favor of just merging because I think it’ll be fine and we can address problems if they arise. But if other people would prefer the more isolated approach I can do that. |
I don't feel particularly strongly, but I would lean towards "temp environment pushed to the load path". |
Instead of pushing to the load path, you could just |
The most isolated thing would be to do what VSCode does and vendor the code of GitHubActions.jl (and it's dependency, JSON.jl) to avoid participating in the package environment altogether. But that seems a bit extreme... |
We need to activate the docs environment though |
Ah fair enough. |
That's not a bad idea. |
Ok, I pushed a commit to use a separate environment for GitHubActions.jl. Now I'll try and test this (ericphanson/VisualStringDistances.jl#16). |
It works! See https://github.com/ericphanson/VisualStringDistances.jl/pull/16/files to see the beautiful annotation (press a if you don't see it), and https://github.com/ericphanson/VisualStringDistances.jl/runs/3726060940?check_suite_focus=true#step:5:14 to confirm we are using our own environment. |
action.yml
Outdated
- run: | | ||
# The Julia command that will be executed | ||
julia_cmd=( julia --color=yes --project=docs/ docs/make.jl ) | ||
julia_cmd=( julia --color=yes --code-coverage --project=docs/ -e ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, I should call out the --code-coverage
flag is a separate addition here. I can split that into a separate PR if desired. The reason I think it's really useful is that it means you can get coverage from doctests just running the process-coverage action after.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A separate PR or two separate commits would be nice so that we can link to them in the release notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I took it out here so this one can be squash-merged and then I’ll make a separate PR to add it
Co-authored-by: Fredrik Ekre <[email protected]>
Co-authored-by: Fredrik Ekre <[email protected]>
Arg, I wasn't testing on julia 1.0 like I thought I was (because I wasn't quoting the version number like the docs say to do). I |
Co-authored-by: Fredrik Ekre <[email protected]>
Things seem to be working on 1.0 (https://github.com/ericphanson/VisualStringDistances.jl/runs/3726621915), and with @fredrikekre's suggestions, our addition of the logger is pretty well isolated from the docs script, so this is good to go from my end. |
Tagged a release: https://github.com/julia-actions/julia-docdeploy/releases/tag/v1.2.0 Thanks everyone :) |
We are getting close to fulfulling all my doctest ambitions 😄 https://github.com/users/ericphanson/projects/1 |
This lets us get inline annotations for doctest errors:
(well, that requires a small fix in Documenter and in GitHubActions.jl as well).
Tested here: https://github.com/ericphanson/VisualStringDistances.jl/runs/3450753006?check_suite_focus=true
Not sure if this should behind a setting (or opt-out), and if the use of the global env is the right way to go. (One way to opt-out though is to just set whatever logger you want yourself inside
docs/make.jl
-- so I think it kind of makes sense that the default should be a GitHubActionsLogger rather than a ConsoleLogger).