Skip to content

Commit

Permalink
chore: add code-quality github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosanif committed Jan 13, 2022
1 parent ca2509f commit 68b4811
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Code Quality Check

on:
# Trigger the workflow on push or pull request,
# but only for the main & develop branch
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
linting:
name: Linting Check
runs-on: ubuntu-latest
steps:
- name: Checkout current repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16.x'

- name: Cache node modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
${{ runner.os }}-
- name: Install dependencies
run: npm ci

- name: Run linting script
run: npm run lint

format:
name: Format Check
runs-on: ubuntu-latest
steps:
- name: Checkout current repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16.x'

- name: Cache node modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
${{ runner.os }}-
- name: Install dependencies
run: npm ci

- name: Run format script
run: npm run format:check

0 comments on commit 68b4811

Please sign in to comment.