-
Notifications
You must be signed in to change notification settings - Fork 189
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
Fixed triple-reporting lint issues #1345
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.
The problem I see with this approach is that we no longer run tests on the other platforms, in which case there is no point having them listed in the matrix.
@raygervais do you have any insight into other ways to reduce the lint spam without shutting off the build matrix?
@yzwdroid this needs a rebase, and an update on where we stand. Are you hoping to get this done in time for 0.3? If so, we need to finalize and merge this today. |
I am thinking if we have a better solution for this. I already have a PR merged for release 0.3. Thanks. |
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.
Alright, I did some research and here's a better way, let's separate the lint and test scripts, and do something like Svelte is doing. Here is their workflow file:
name: CI
on: [push, pull_request]
jobs:
Tests:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
node-version: [8, 10, 12, 14]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
env:
CI: true
Lint:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- run: 'npm i && npm run lint'
Unit:
runs-on: ${{ matrix.os }}
timeout-minutes: 5
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- run: 'npm i && npm run test:unit'
To do this, we'll need to get rid of test-ci
and do these three things separately:
npm run prettier-check
to make sure the PR has proper formatting. Do this only on linuxnpm run eslint
to make sure the PR passes lint. Do this only on linuxnpm run test
to make sure the PR passes tests. Do this on all OSes
Thanks for the help @humphd . I changed the condition as you mentioned. |
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.
You haven't done what I asked. Can you split up the jobs so that we have separate prettier, eslint, and test phases that can run in parallel?
I am a little confused about this approach. If we run all the jobs async, then we need to do |
Not if we also add caching, see https://docs.github.com/en/free-pro-team@latest/actions/guides/caching-dependencies-to-speed-up-workflows. |
I'll add the cache, and commit it later. |
.github/workflows/node-js-ci.yml
Outdated
@@ -28,4 +28,16 @@ jobs: | |||
- run: npm install | |||
- run: cp env.example .env | |||
- run: npm run build |
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.
Let's get rid of this build step too, since we aren't using the build in CI.
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.
See b615e5c, where I'm doing that for another PR too.
After I add the cache, the build time reduced from 3m 30 s to 2m 54s on Ubuntu from my repo https://github.com/yzwdroid/telescope/runs/1449300001?check_suite_focus=true. I'm not sure if I have done it right. |
Let's get this rebased for the conflict that's in node-js-ci.yml. |
I rebased the current commit, Is there any code to be changed? |
Issue This PR Addresses
Fixes #1336
Type of Change
Description
only run
test-ci
when the os isubuntu
Checklist