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

ci: Add eslint action #244

Merged
merged 4 commits into from
Jun 11, 2020
Merged

ci: Add eslint action #244

merged 4 commits into from
Jun 11, 2020

Conversation

abmusse
Copy link
Member

@abmusse abmusse commented Apr 9, 2020

@abmusse abmusse requested a review from kadler April 9, 2020 01:37
@kadler
Copy link
Member

kadler commented Apr 17, 2020

It fails to install node-odbc due to

 gyp ERR! find Python 
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python 
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python 
gyp ERR! configure error 

It runs the action in the node10-slim docker container, so maybe it the container doesn't have the required dependencies to run node-gyp.

@abmusse abmusse added the keep-open Exempts stale action from auto closing the issue/pr. label May 13, 2020
@abmusse
Copy link
Member Author

abmusse commented May 13, 2020

@kadler

It runs the action in the node10-slim docker container, so maybe it the container doesn't have the required dependencies to run node-gyp.

Thats true but I don't think that causes the run to fail because odbc is an optional dep. Following the npm log there is the following:

added 445 packages from 1066 contributors and audited 1888 packages in 8.676s

25 packages are looking for funding
  run `npm fund` for details

found 6 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
Error Error: Received status code 401
    at IncomingMessage.res.on (/action/lib/request.js:13:25)
    at IncomingMessage.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
{"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"}

I'm thinking this error originates from a permissions issue from https://github.com/hallee/eslint-action/blob/master/lib/run.js#L103

https://developer.github.com/v3/checks/runs/

@abmusse
Copy link
Member Author

abmusse commented May 14, 2020

Alternatively we can use https://github.com/stefanoeb/eslint-action. This wont annotate the diffs of your pull requests with lint errors and warnings though. It uses the eslint CLI.

@abmusse abmusse force-pushed the add-eslint-action branch from 7f9e856 to bbfbfdf Compare May 14, 2020 16:18
@abmusse
Copy link
Member Author

abmusse commented May 14, 2020

Using https://github.com/stefanoeb/eslint-action was successful although the run logs a ton of Warning: .then() only accepts functions but was passed: [object Object]. Did some research and found this is caused by https://npm.community/t/npm-ci-produces-a-tonn-of-excess-warnings-on-install/3261. Opened stefanoeb/eslint-action#10 to resolve the problem.

@abmusse
Copy link
Member Author

abmusse commented Jun 9, 2020

@kadler how about we simply run eslint during our CI action. Something similar to the suggestion here: stefanoeb/eslint-action#8 (comment)

@kadler
Copy link
Member

kadler commented Jun 11, 2020

Yeah, I think it would be better to call out to npm run lint (which as an aside sounds like it would be better as npm run linter instead, but our test and test-integration scripts follow the same style so 🤷)

@abmusse abmusse force-pushed the add-eslint-action branch from bbfbfdf to 79ae206 Compare June 11, 2020 16:27
@abmusse abmusse closed this Jun 11, 2020
@abmusse abmusse reopened this Jun 11, 2020
Copy link
Member

@kadler kadler left a comment

Choose a reason for hiding this comment

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

LGTM

@kadler kadler merged commit 22c691b into master Jun 11, 2020
@kadler kadler deleted the add-eslint-action branch June 11, 2020 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep-open Exempts stale action from auto closing the issue/pr.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run linter during PR
2 participants