Skip to content

Commit ccecbf8

Browse files
committed
ci: 🎡 github workflow ci
1 parent 4863147 commit ccecbf8

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

.github/workflows/ci.yaml

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: CI workflow
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
5+
cancel-in-progress: true
6+
7+
env:
8+
NODE_VERSION: 20.14.0
9+
PNPM_VERSION: 9.6.0
10+
11+
on:
12+
push:
13+
branches: main
14+
pull_request:
15+
branches: '**'
16+
workflow_dispatch:
17+
18+
jobs:
19+
init:
20+
name: Initial Common Steps
21+
runs-on: ubuntu-latest
22+
outputs:
23+
cache-hit: ${{ steps.cache.outputs.cache-hit }}
24+
25+
steps:
26+
- name: Git checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup pnpm
30+
uses: pnpm/action-setup@v4
31+
with:
32+
version: ${{ env.PNPM_VERSION }}
33+
34+
- name: Setup Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: ${{ env.NODE_VERSION }}
38+
39+
- name: Cache dependencies
40+
id: cache
41+
uses: actions/cache@v4
42+
with:
43+
path: ~/.pnpm-store
44+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
45+
46+
- name: Install dependencies
47+
if: steps.cache.outputs.cache-hit != 'true'
48+
run: pnpm install --frozen-lockfile
49+
50+
lint:
51+
name: Lint
52+
runs-on: ubuntu-latest
53+
needs: init
54+
55+
steps:
56+
- name: Git checkout
57+
uses: actions/checkout@v4
58+
59+
- name: Setup pnpm
60+
uses: pnpm/action-setup@v4
61+
with:
62+
version: ${{ env.PNPM_VERSION }}
63+
64+
- name: Setup Node.js
65+
uses: actions/setup-node@v4
66+
with:
67+
node-version: ${{ env.NODE_VERSION }}
68+
69+
- name: Cache dependencies
70+
uses: actions/cache@v4
71+
with:
72+
path: ~/.pnpm-store
73+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
74+
75+
- name: Install dependencies
76+
if: needs.init.outputs.cache-hit != 'true'
77+
run: pnpm install --frozen-lockfile
78+
79+
- name: Run linters
80+
run: pnpm eslint:all

0 commit comments

Comments
 (0)