Skip to content

Commit

Permalink
feat: add Github Actions workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Anmol Sharma <anmolsharma0234@gmail.com>
  • Loading branch information
theanmolsharma committed Apr 6, 2024
1 parent 571f0ad commit 47ef09d
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/actions-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'Lint'
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
types:
- opened
- synchronize
- reopened
- ready_for_review
jobs:
check-formatting-and-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20.12.x
cache: npm
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Install Dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm install
- name: Run prettier
run: npm run format:check
- name: Run eslint
if: success() || failure()
run: npm run lint:check
- name: Run Typescript Compilation Check
run: npm run types:check
35 changes: 35 additions & 0 deletions .github/workflows/actions-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'Tests'
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
types:
- opened
- synchronize
- reopened
- ready_for_review
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20.12.x
cache: npm
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Install Dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm install
- name: Run unit tests with coverage
run: npm run test

0 comments on commit 47ef09d

Please sign in to comment.