Skip to content

Commit 759ea42

Browse files
authored
Merge pull request #13 from SameerJS6/add-github-workflows
add: github actions
2 parents 9f143bb + ade68f8 commit 759ea42

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

.github/workflows/ci.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: ["*"]
6+
push:
7+
branches: ["main"]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
13+
name: linting
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Install pnpm
21+
id: install-pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: 9.15.1
25+
run_install: false
26+
27+
- name: Install Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: 20
31+
cache: "pnpm"
32+
33+
- name: Get Pnpm Store directory
34+
id: pnpm-cache
35+
run: |
36+
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
37+
38+
- name: Pnpm cache
39+
uses: actions/cache@v4
40+
with:
41+
path: ${{steps.pnpm-cache.outputs.pnpm_cache_dir}}
42+
key: ${{runner.os}}-pnpm-cache-${{hashFiles('**/pnpm-lock.yaml')}}
43+
restore-keys: |
44+
${{runner.os}}-pnpm-cache-
45+
46+
- name: Install Package Depenedency
47+
run: pnpm install --frozen-lockfile
48+
49+
- name: Run Lint
50+
run: pnpm lint
51+
52+
build:
53+
runs-on: ubuntu-latest
54+
needs: lint
55+
56+
name: building
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@v4
60+
61+
- name: Install Pnpm
62+
uses: pnpm/action-setup@v4
63+
with:
64+
run_install: false
65+
version: 9.15.1
66+
67+
- name: Install Node.js
68+
uses: actions/setup-node@v4
69+
with:
70+
node-version: 20
71+
cache: "pnpm"
72+
73+
- name: Install Dependenices
74+
run: pnpm install --frozen-lockfile
75+
76+
- name: Build Project
77+
run: pnpm build

0 commit comments

Comments
 (0)