Skip to content

Commit 1e309a1

Browse files
authored
Merge pull request #264 from alcpereira/ci/add-format-typecheck
ci: add format check and typecheck
2 parents 073e8cd + 1df6199 commit 1e309a1

File tree

5 files changed

+38
-0
lines changed

5 files changed

+38
-0
lines changed

.github/workflows/ci.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,38 @@ on:
55
pull_request:
66

77
jobs:
8+
"typecheck":
9+
name: "Typecheck"
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 2
12+
steps:
13+
- name: "Checkout this repo"
14+
uses: actions/checkout@v4
15+
- name: "Setup Node.js"
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: "18.x"
19+
- name: "Install node dependencies and build"
20+
run: "npm ci && npm run build"
21+
- name: "Typecheck"
22+
run: "npm run typecheck"
23+
24+
"format-check":
25+
name: "Check formatting"
26+
runs-on: ubuntu-latest
27+
timeout-minutes: 2
28+
steps:
29+
- name: "Checkout this repo"
30+
uses: actions/checkout@v4
31+
- name: "Setup Node.js"
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: "18.x"
35+
- name: "Install node dependencies"
36+
run: "npm ci"
37+
- name: "Check formatting"
38+
run: "npm run format:check"
39+
840
"test-against-sqld":
941
name: "Tests against sqld"
1042
runs-on: ubuntu-latest

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"lint-staged": "^15.2.2"
1010
},
1111
"scripts": {
12+
"build": "npm run build --workspaces",
13+
"typecheck": "npm run typecheck --workspaces",
14+
"format:check": "npm run format:check --workspaces",
1215
"prepare": "node .husky/install.mjs",
1316
"lint-staged": "lint-staged"
1417
}

packages/libsql-client-wasm/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"build": "npm run build:esm",
5353
"build:esm": "tsc -p tsconfig.build-esm.json",
5454
"bundle": "rm -rf node_modules && mkdir -p node_modules/@libsql/libsql-wasm-experimental && cp -R ../../node_modules/@libsql/libsql-wasm-experimental/* node_modules/@libsql/libsql-wasm-experimental",
55+
"format:check": "prettier --check .",
5556
"test": "jest --runInBand",
5657
"typecheck": "tsc --noEmit",
5758
"typedoc": "rm -rf ./docs && typedoc"

packages/libsql-client/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
"build": "npm run build:cjs && npm run build:esm",
9696
"build:cjs": "tsc -p tsconfig.build-cjs.json",
9797
"build:esm": "tsc -p tsconfig.build-esm.json",
98+
"format:check": "prettier --check .",
9899
"postbuild": "cp package-cjs.json ./lib-cjs/package.json",
99100
"test": "jest --runInBand",
100101
"typecheck": "tsc --noEmit",

packages/libsql-core/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"build": "npm run build:cjs && npm run build:esm",
7272
"build:cjs": "tsc -p tsconfig.build-cjs.json",
7373
"build:esm": "tsc -p tsconfig.build-esm.json",
74+
"format:check": "prettier --check .",
7475
"postbuild": "cp package-cjs.json ./lib-cjs/package.json",
7576
"test": "jest --runInBand",
7677
"typecheck": "tsc --noEmit",

0 commit comments

Comments
 (0)