Skip to content

Commit 669f979

Browse files
committed
feat: test on node 14 and 16
1 parent 7f13c3a commit 669f979

File tree

6 files changed

+23
-15
lines changed

6 files changed

+23
-15
lines changed

.github/workflows/build.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,26 @@ on: ["push", "pull_request"]
33

44
jobs:
55
test:
6-
name: Build and test
7-
runs-on: ubuntu-20.04
6+
name: Test
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
node: [14, 16]
811
steps:
912
- uses: actions/checkout@v1
1013

11-
- name: Use Node.js 16
14+
- name: Use Node.js ${{ matrix.node }}
1215
uses: actions/setup-node@v1
1316
with:
14-
node-version: 16
17+
node-version: ${{ matrix.node }}
1518

1619
- name: Test and generate coverage
1720
run: |
1821
npm ci
19-
npm run test:prod
22+
npm run test:ci
2023
2124
- name: Coveralls
25+
if: matrix.node == 16
2226
uses: coverallsapp/github-action@master
2327
with:
2428
github-token: ${{ secrets.GITHUB_TOKEN }}

.husky/pre-push

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npm run test:prod && npm run build
4+
npm run test:ci && npm run build

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424
},
2525
"license": "MIT",
2626
"engines": {
27-
"node": ">=16.0.0"
27+
"node": ">=14.0.0"
2828
},
2929
"scripts": {
3030
"lint": "eslint --fix 'src/**/*.ts'",
3131
"prebuild": "rimraf lib",
3232
"build": "tsc --project tsconfig.build.json",
3333
"build:docs": "typedoc --out docs src/create-ts-lib-gh.ts",
3434
"test": "jest --config jest.config.ts --coverage",
35-
"test:prod": "npm run lint && npm run test -- --no-cache"
35+
"test:ci": "npm run lint && npm run test -- --no-cache"
3636
},
3737
"lint-staged": {
3838
"{src,test}/**/*.ts": [

template/.github/workflows/build.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,26 @@ on: ["push", "pull_request"]
33

44
jobs:
55
test:
6-
name: Build and test
7-
runs-on: ubuntu-20.04
6+
name: Test
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
node: [14, 16]
811
steps:
912
- uses: actions/checkout@v1
1013

11-
- name: Use Node.js 16
14+
- name: Use Node.js ${{ matrix.node }}
1215
uses: actions/setup-node@v1
1316
with:
14-
node-version: 16
17+
node-version: ${{ matrix.node }}
1518

1619
- name: Test and generate coverage
1720
run: |
1821
npm ci
19-
npm run test:prod
22+
npm run test:ci
2023
2124
- name: Coveralls
25+
if: matrix.node == 16
2226
uses: coverallsapp/github-action@master
2327
with:
2428
github-token: ${{ secrets.GITHUB_TOKEN }}

template/.husky/pre-push

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npm run test:prod && npm run build
4+
npm run test:ci && npm run build

template/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"build": "tsc --project tsconfig.build.json",
2626
"build:docs": "typedoc --out docs src/<%= str(library.name) %>.ts",
2727
"test": "jest --config jest.config.ts --coverage",
28-
"test:prod": "npm run lint && npm run test -- --no-cache"
28+
"test:ci": "npm run lint && npm run test -- --no-cache"
2929
},
3030
"lint-staged": {
3131
"{src,test}/**/*.ts": [

0 commit comments

Comments
 (0)