-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add code-quality github workflow
- Loading branch information
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |