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
fb55
left a comment
There was a problem hiding this comment.
This looks great. Added some questions.
| on: | ||
| push: | ||
| branches-ignore: | ||
| - 'dependabot/**' |
There was a problem hiding this comment.
Will we still run tests for Dependabot PRs with this?
There was a problem hiding this comment.
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.
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.
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.
The pattern in the site action is great, maybe just copy that?
There was a problem hiding this comment.
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.
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.
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.
| - uses: actions/setup-node@v2 | ||
| with: | ||
| node-version: 14.x | ||
| node-version: '${{ env.NODE }}' |
| <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.
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.
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.
Wouldn't separate jobs be executed in parallel as well?
There was a problem hiding this comment.
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.
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-testbut that was using@npm run test:lintwhich doesn't exist; I changed it to@npm run lintbut the makefile isn't up to date.npm testbut IMHO the Makefile should be removed to avoid confusion since it's clearly brokenmake travis-testis failing;test-covalso 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=trueNotes:
LTStags, I explicitly set this to 14 in an env varEDIT: it seems that
npm testdidn't even run on Travis CI hence why the failures weren't caught sooner.