Skip to content
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

build: add GitHub actions to run linters #31323

Closed
wants to merge 2 commits into from

Conversation

richardlau
Copy link
Member

Add jobs to our GitHub Actions workflow to run our various lint Makefile
targets. The setup-node action used to run the JavaScript linter contains
problem matchers for eslint that will annotate the files in a pull request if
there are failures.

The Python linting has been left out as I believe it's being included as part of
#29474.

See https://github.com/richardlau/node-1/pull/3/files for an example of the
annotations for lint-js failures.
image

We may be able to create problem matchers for the cpplint.py and markdown
linters in the future based on
https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Add jobs to our GitHub Actions workflow to run our
various lint Makefile targets. The `setup-node` action
used to run the JavaScript linter contains problem
matchers for eslint that will annotate the files in a pull
request if there are failures.
@nodejs-github-bot nodejs-github-bot added the meta Issues and PRs related to the general management of the project. label Jan 12, 2020
@richardlau richardlau added the build Issues and PRs related to build files or the CI. label Jan 12, 2020
Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 12, 2020
.github/workflows/CI.yml Outdated Show resolved Hide resolved
The CI workflow doesn't use the matrix strategy so there is no
`${{ matrix.node-version }}` variable to use in the `Use Node.js`
step names.
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: 10.x
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to use 12.x. It should be faster and will be supported for a longer time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I deliberately went for the earliest in support version of Node.js on the basis that it would alert us if any of our tooling involved in the linting would break on it and thus help apply dont-land-on labels (with an assumption that its very unlikely that something would break on 12 but not 10).

As for speed the lint checks are completing in less than 2 minutes which is a fraction of the time taken to run the build jobs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to have such guarantees, we could even let it run on both versions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally in the long term when actions/setup-node#26 is addressed we can put an alias in here like lts if the concern is that the version here will eventually need to be updated.

@Trott
Copy link
Member

Trott commented Jan 14, 2020

Since this file is not exercised or even linted in Jenkins CI, green GitHub actions and Travis should be sufficient to land.

@Trott
Copy link
Member

Trott commented Jan 14, 2020

Landed in f4a4a1a...b772b9a

@Trott Trott closed this Jan 14, 2020
Trott pushed a commit that referenced this pull request Jan 14, 2020
Add jobs to our GitHub Actions workflow to run our
various lint Makefile targets. The `setup-node` action
used to run the JavaScript linter contains problem
matchers for eslint that will annotate the files in a pull
request if there are failures.

PR-URL: #31323
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Trott pushed a commit that referenced this pull request Jan 14, 2020
The CI workflow doesn't use the matrix strategy so there is no
`${{ matrix.node-version }}` variable to use in the `Use Node.js`
step names.

PR-URL: #31323
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@richardlau richardlau deleted the lintactions branch January 14, 2020 05:55
MylesBorins pushed a commit that referenced this pull request Jan 16, 2020
Add jobs to our GitHub Actions workflow to run our
various lint Makefile targets. The `setup-node` action
used to run the JavaScript linter contains problem
matchers for eslint that will annotate the files in a pull
request if there are failures.

PR-URL: #31323
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 16, 2020
The CI workflow doesn't use the matrix strategy so there is no
`${{ matrix.node-version }}` variable to use in the `Use Node.js`
step names.

PR-URL: #31323
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@codebytere codebytere mentioned this pull request Jan 16, 2020
codebytere pushed a commit that referenced this pull request Mar 14, 2020
Add jobs to our GitHub Actions workflow to run our
various lint Makefile targets. The `setup-node` action
used to run the JavaScript linter contains problem
matchers for eslint that will annotate the files in a pull
request if there are failures.

PR-URL: #31323
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
codebytere pushed a commit that referenced this pull request Mar 14, 2020
The CI workflow doesn't use the matrix strategy so there is no
`${{ matrix.node-version }}` variable to use in the `Use Node.js`
step names.

PR-URL: #31323
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
MylesBorins pushed a commit to MylesBorins/node that referenced this pull request Apr 2, 2020
Add jobs to our GitHub Actions workflow to run our
various lint Makefile targets. The `setup-node` action
used to run the JavaScript linter contains problem
matchers for eslint that will annotate the files in a pull
request if there are failures.

PR-URL: nodejs#31323
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
MylesBorins pushed a commit to MylesBorins/node that referenced this pull request Apr 2, 2020
The CI workflow doesn't use the matrix strategy so there is no
`${{ matrix.node-version }}` variable to use in the `Use Node.js`
step names.

PR-URL: nodejs#31323
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
MylesBorins pushed a commit that referenced this pull request Apr 2, 2020
Add jobs to our GitHub Actions workflow to run our
various lint Makefile targets. The `setup-node` action
used to run the JavaScript linter contains problem
matchers for eslint that will annotate the files in a pull
request if there are failures.

Backport-PR-URL: #32608
PR-URL: #31323
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
MylesBorins pushed a commit that referenced this pull request Apr 2, 2020
The CI workflow doesn't use the matrix strategy so there is no
`${{ matrix.node-version }}` variable to use in the `Use Node.js`
step names.

Backport-PR-URL: #32608
PR-URL: #31323
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@codebytere codebytere mentioned this pull request Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. build Issues and PRs related to build files or the CI. meta Issues and PRs related to the general management of the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants