-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Introduce github workflows for cspell and textlint #2971
Introduce github workflows for cspell and textlint #2971
Conversation
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'd like to suggest that this PR only introduce github workflows for cspell and textlint, without attempting any optimizations for any of the GH actions (new or existing). Optimizations should be addressed and discussed separately IMHO.
For example, the choice to not commit package-lock.json
is deliberate: it is a royal pain to have to deal with that file in merge and rebase conflicts -- it's just not worth it for a website that isn't, say, a single-page app.
I have an idea of how to optimize the GH actions without it, but just haven't had the time to investigate, given that optimizing seconds off (ok half a minute :)) of GH actions hasn't been a priority.
WDYT?
I got carried away a little bit while playing around with this PR, so yes, let me only introduce the workflows for cspell & textlint and remove the rest:-) |
@chalin all green, all addressed hope this works for you :-) |
No worries, I understand! Taking a look now. |
0fdf9c5
to
f270ea4
Compare
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.
Very nice, thanks!
See inline comments and questions.
.github/workflows/check-text.yml
Outdated
- uses: actions/checkout@v3 | ||
# Make sure that we only install the dependencies for textlint to speed up install | ||
- run: | | ||
jq 'del(.dependencies) | .scripts |= with_entries(select(.key | contains("check:"))) | .devDependencies |= with_entries( select(.key | startswith("textlint")))' package.json > package2.json && mv package2.json package.json |
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 few questions:
- Why prune the scripts?
- Simplify
package.json > package2.json && mv package2.json package.json
to just
package.json > package.json
?
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.
- if I don't prune the scripts it runs all of the npm install dependencies which loads submodules, etc., which is a big hit on performance
- because if I do jq package.json > package.json the input file is overwritten and I get an empty file
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.
- For scripts, all you should need is to removed
prepare
-- I don't know if that can help simplify the jq arguments. - Ok (re file override)
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, actually, without modifying scripts
, you can avoid prepare
being run by adding the --ignore-scripts
flag to the two npm
commands below.
Co-authored-by: Patrice Chalin <chalin@users.noreply.github.com>
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.
LGTM, other than possibly using the --ignore-scripts
flag as mentioned in the inline comment.
fixed. TY |
With all files in
content/
being clean right now we are ready to introduce cspell & textlint as github workflows.