-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Switch to GitHub Actions CI #1600
Conversation
I decided to split the actions so that lint and tests are done faster. So, things that remain:
|
Tests should be fixed with #1596 |
@fb55 so, how do you think we should proceed with the remaining TODOs? Also, is there something you want me to change? |
One can use [bench skip] or [skip bench] in the commit message to skip running the benchmark action
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.
This looks great. Added some questions.
on: | ||
push: | ||
branches-ignore: | ||
- 'dependabot/**' |
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.
Will we still run tests for Dependabot PRs with this?
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.
Yup, since depndabot always opens a PR, this just skips the branches.
.github/workflows/ci.yml
Outdated
|
||
- name: Run Jest with coverage | ||
run: npm run test:jest:cov | ||
if: matrix.node == 14 |
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.
Would it make sense to move this to an env var, so that there is only a single reference to the Node version used for coverage?
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.
Can do, how do you want to name the env var? Also, do you want the env var to be in the global scope or under the job?
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.
The pattern in the site action is great, maybe just copy that?
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, it's just that it might not be self-explanatory using NODE
, but I can add a comment.
Also, we could just run jest with --coverage
regardless of the Node version, and just run coveralls only on Node.js 14. That would be less lines.
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.
Saw you changed the name to NODE_COV, which should be easy enough to distinguish.
we could just run jest with --coverage regardless of the Node version
I like that idea as well. But the current slight duplication isn't too bad either 🙂
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.
Your call. There isn't so much of a difference, just 3 seconds. I'll leave it as is and you can change it later if needed.
@@ -12,7 +17,15 @@ jobs: | |||
- uses: actions/checkout@v2 | |||
- uses: actions/setup-node@v2 | |||
with: | |||
node-version: 14.x | |||
node-version: '${{ env.NODE }}' |
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.
This is great 👌
<a href="https://travis-ci.org/cheeriojs/cheerio"> | ||
<img src="https://img.shields.io/travis/cheeriojs/cheerio/main" alt="Travis CI"> | ||
<a href="https://github.com/cheeriojs/cheerio/actions?query=workflow%3ACI+branch%3Amain"> | ||
<img src="https://img.shields.io/github/workflow/status/cheeriojs/cheerio/CI/main" alt="Build Status"> |
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.
Should lint and CI be in the same file (as different jobs), to make this cover both? (That's the current behavior, but I can also see a point about having them be separate.)
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.
The reason I split the actions is so that everything is faster since they run in parallel this way. I doubt having a badge to lint is something that people should care about :)
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.
Wouldn't separate jobs be executed in parallel as well?
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.
Yeah, but I personally find this cleaner. Each workflow does one thing. That being said, the types test could probably be moved to the lint workflow.
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.
Makes sense & I can live with this.
I'm happy to go forward with this. Super excited to see this land. @XhmikosR The PR is still a draft. Let me know when you feel ready to proceed. |
I'm still not sure about keeping the Makefile around. It's unnecessary duplication and it seems Makefile has a script that is not present in package.json (xyz). I'll leave that to you to sort later :) PS. I'm still being bitten by #1602 since my dev VM is on Windows. |
This should allow caches to be shared between workflows.
Good point about the Makefile. Thanks so much for this PR, this moves us forward considerably. |
@fb55 a few more things to do:
|
It seems there are a few issues:
.travis.yml was usingEDIT: I switched tomake travis-test
but that was using@npm run test:lint
which doesn't exist; I changed it to@npm run lint
but the makefile isn't up to date.npm test
but IMHO the Makefile should be removed to avoid confusion since it's clearly brokenmake travis-test
is failing;test-cov
also doesn't seem to work. Happy to sort everything out as long as you give me some hints. My suggestion is to move everything to npm scripts only and Actions including coverage.BENCHMARK=true
Notes:
LTS
tags, I explicitly set this to 14 in an env varEDIT: it seems that
npm test
didn't even run on Travis CI hence why the failures weren't caught sooner.