From cceef186dcc957d7b5078254e3e3a86f059deee6 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Sun, 12 Jan 2020 00:58:19 +0000 Subject: [PATCH] build: add GitHub actions to run linters 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: https://github.com/nodejs/node/pull/31323 Reviewed-By: Ruben Bridgewater Reviewed-By: Anna Henningsen Reviewed-By: Jiawen Geng Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig --- .github/workflows/CI.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 47b59836300086..e63b95c0c0e658 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -41,3 +41,39 @@ jobs: 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 ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: 10.x + - 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 ${{ matrix.node-version }} + 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 ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: Lint JavaScript files + run: NODE=$(which node) make lint-js