Skip to content

Commit

Permalink
Replace Super-Linter with explicit ESLint workflow on changed files
Browse files Browse the repository at this point in the history
  • Loading branch information
meganindya committed Jan 29, 2021
1 parent b51fa32 commit 23246b0
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 66 deletions.
44 changes: 0 additions & 44 deletions .github/linters/.eslintrc.json

This file was deleted.

38 changes: 26 additions & 12 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Super-Linter
name: ESLint

# Triggers the workflow on push or pull request events only for the master branch
on:
push:
branches: [master]
Expand All @@ -9,21 +8,36 @@ on:

jobs:
build:
name: Lint updated JavaScript files
name: Lint updated JavaScript files with ESLint

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- name: Checkout code
# Checks-out repository under $GITHUB_WORKSPACE, so job can access it
uses: actions/checkout@v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0

- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Get changed files
id: getfile
run: echo "::set-output name=files::$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | xargs)"

- name: Install ESLint
run: npm install eslint

- name: Run Super-Linter
uses: github/super-linter@v3
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_JAVASCRIPT_STANDARD: false # VALIDATE_JAVASCRIPT_ES is desired (true by default)
VALIDATE_JSCPD: false
- name: Lint changed files using ESLint
run: |
for i in ${{ steps.getfile.outputs.files }}
do
echo "file $i"
if [[ "$i" == *".js" ]]
then
echo "linting $i"
npx eslint $i
fi
done
24 changes: 14 additions & 10 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI
name: Smoke Test

on:
push:
Expand All @@ -11,18 +11,22 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

strategy:
matrix:
node-version: [12.x, 14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- run: npm ci
- run: npm run build --if-present

0 comments on commit 23246b0

Please sign in to comment.