Skip to content

Commit 2de674e

Browse files
authored
add ci (#1)
1 parent bd554cf commit 2de674e

File tree

5 files changed

+41
-6
lines changed

5 files changed

+41
-6
lines changed

.github/workflows/test.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Test and Lint
2+
3+
on:
4+
push:
5+
branches: [ 'main' ]
6+
pull_request:
7+
branches: ['*']
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [16.x]
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
- name: Install dependencies
25+
run: yarn install
26+
- name: Run Lint
27+
run: yarn lint
28+
- name: Run test
29+
run: yarn coverage:ci

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ website
1919
renovate.json
2020
.prettierignore
2121
.prettierrc
22+
.github/**/*
2223
publish.sh
2324
jest.config.js

jest.config.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
jest.config.jsrequire('ts-node/register');
2-
31
module.exports = {
4-
'moduleFileExtensions': [
2+
moduleFileExtensions: [
53
'js',
64
'json',
75
'ts',
86
],
9-
'rootDir': 'lib',
10-
'testRegex': '/lib/.*\\.spec\\.(ts|js)$',
11-
'preset': 'ts-jest',
7+
coverageThreshold: {
8+
global: {
9+
lines: 95,
10+
},
11+
},
12+
rootDir: 'lib',
13+
testRegex: '/lib/.*\\.spec\\.(ts|js)$',
14+
preset: 'ts-jest',
1215
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"prebuild": "rimraf dist",
2020
"build": "tsc -p tsconfig.build.json",
2121
"test": "jest",
22+
"coverage:ci": "jest --coverage",
2223
"lint": "tsc --noEmit && eslint ."
2324
},
2425
"peerDependencies": {

0 commit comments

Comments
 (0)