Skip to content

Commit a65f7bc

Browse files
committed
ci: auto test, lint & prettier on push/pull request
1 parent f088166 commit a65f7bc

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.github/workflows/ci-test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Test and Lint
2+
on:
3+
push:
4+
branches: [master]
5+
pull_request:
6+
branches: [master]
7+
jobs:
8+
test:
9+
name: Test and Lint
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Install packages
14+
run: npm ci
15+
- name: Prettier
16+
run: npm run format:check
17+
- name: Lint
18+
run: npm run lint
19+
- name: Test code
20+
run: npm test

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"build": "rimraf dist && tsc && tsc -p tsconfig.esm.json && node build-scripts/dist-package-json",
3131
"prepublish": "npm run build",
3232
"prepare": "husky install",
33+
"format:check": "prettier --check **/*.{ts,js} !**/dist/** !**/node_modules/**",
3334
"lint": "eslint . --ext .ts",
3435
"start": "ts-node demo/emulator-run.ts",
3536
"start:micropython": "ts-node demo/micropython-run.ts",

0 commit comments

Comments
 (0)