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
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 39 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js 13
uses: actions/setup-node@v1
with:
node-version: 13.x
Expand All @@ -19,7 +19,7 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js 13
uses: actions/setup-node@v1
with:
node-version: 13.x
Expand All @@ -33,11 +33,47 @@ jobs:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js 13
uses: actions/setup-node@v1
with:
node-version: 13.x
- name: Environment Information
run: npx envinfo
- name: Build
run: ./configure && make -j8
lint-addon-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 10
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.

- name: Lint addon docs
run: NODE=$(which node) make lint-addon-docs
lint-cpp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Lint C/C++ files
run: make lint-cpp
lint-md:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 10
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Lint docs
run: NODE=$(which node) make lint-md
lint-js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 10
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Lint JavaScript files
run: NODE=$(which node) make lint-js