Skip to content

Commit 9da4073

Browse files
committed
ci: add github ci
1 parent 28afa37 commit 9da4073

File tree

3 files changed

+74
-3
lines changed

3 files changed

+74
-3
lines changed

.github/workflows/ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [master]
9+
pull_request:
10+
branches: [master]
11+
12+
jobs:
13+
check:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
node-version: [18.x, 20.x]
18+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Install pnpm
25+
uses: pnpm/[email protected]
26+
with:
27+
version: 9.7.0
28+
29+
- name: Use Node.js ${{ matrix.node-version }}
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
cache: 'pnpm'
34+
35+
- name: Install dependencies
36+
run: pnpm install --frozen-lockfile
37+
38+
- name: Run prettier check
39+
run: pnpm prettier-check
40+
41+
- name: Run tsc check
42+
run: pnpm check-types
43+
44+
build:
45+
runs-on: ubuntu-latest
46+
strategy:
47+
matrix:
48+
node-version: [18.x, 20.x]
49+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
50+
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
55+
- name: Install pnpm
56+
uses: pnpm/[email protected]
57+
with:
58+
version: 9.7.0
59+
60+
- name: Use Node.js ${{ matrix.node-version }}
61+
uses: actions/setup-node@v4
62+
with:
63+
node-version: ${{ matrix.node-version }}
64+
cache: 'pnpm'
65+
66+
- name: Install dependencies
67+
run: pnpm install --frozen-lockfile
68+
69+
- name: Run Build
70+
run: pnpm build

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ package-lock.json
88
.parcel-cache
99
.vscode
1010
example
11-
*.tgz
11+
*.tgz
12+
.DS_Store

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"watch": "rm -rf lib && tsc --watch",
2626
"release": "npm run build && node ./scripts/release.js",
2727
"check-types": "tsc --noEmit --skipLibCheck",
28-
"lint": "prettier --check './src/**/*.{js,jsx,tsx,ts,less}'",
29-
"lint-fix": "prettier --write './src/**/*.{js,jsx,tsx,ts,less}'"
28+
"format": "prettier --check './src/**/*.{js,jsx,tsx,ts,less}'",
29+
"prettier-check": "prettier --write './src/**/*.{js,jsx,tsx,ts,less}'"
3030
},
3131
"publishConfig": {
3232
"registry": "https://registry.npmjs.org/"

0 commit comments

Comments
 (0)