Skip to content

Commit

Permalink
add lint ci
Browse files Browse the repository at this point in the history
  • Loading branch information
karanrainafynd committed Jun 2, 2024
1 parent 0b953fb commit fa6cd82
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 22 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/lint-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Node.js Lint Check

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint-check:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- name: Checkout repository
uses: actions/checkout@v2

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

- name: Install dependencies
run: npm install

- name: Run linter
run: npm run linter
41 changes: 20 additions & 21 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,30 @@ on:

jobs:
unit-test:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]

steps:
- name: Checkout repository
uses: actions/checkout@v2

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

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test

- name: Upload coverage report
if: success()
uses: actions/upload-artifact@v2
with:
name: coverage-report
path: .tap/coverage/
- name: Checkout repository
uses: actions/checkout@v2

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

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test

- name: Upload coverage report
if: success()
uses: actions/upload-artifact@v2
with:
name: coverage-report
path: .tap/coverage/
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"scripts": {
"test": "tap test/**/*.test.ts",
"build": "tsc",
"linter": "eslint . --fix --ext .ts",
"linter:fix": "eslint . --fix --ext .ts",
"linter": "eslint . --ext .ts",
"format": "prettier --write .",
"lint": "npm run format && npm run linter"
},
Expand Down

0 comments on commit fa6cd82

Please sign in to comment.