Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 58bb2b9

Browse files
committed
added actions for automated testing
1 parent 7a91c20 commit 58bb2b9

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

.github/workflows/nodejs.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
tags:
7+
- "!*" # Do not execute on tags
8+
paths:
9+
- src/*
10+
- test/*
11+
- __tests__/*
12+
- "*.json"
13+
- yarn.lock
14+
- .github/**/*.yml
15+
pull_request:
16+
paths:
17+
- "!*.MD"
18+
jobs:
19+
test:
20+
strategy:
21+
matrix:
22+
platform: [ubuntu-latest, macOS-latest]
23+
node: ["12", "10"]
24+
name: test/node ${{ matrix.node }}/${{ matrix.platform }}
25+
runs-on: ${{ matrix.platform }}
26+
steps:
27+
- uses: actions/checkout@master
28+
- uses: actions/setup-node@master
29+
with:
30+
node-version: ${{ matrix.node }}
31+
- run: npm install -g yarn
32+
- run: yarn install
33+
- run: yarn build
34+
- run: yarn test
35+
coverage:
36+
needs: [test]
37+
name: coverage
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@master
41+
- uses: actions/setup-node@master
42+
with:
43+
node-version: "12"
44+
- run: npm install -g yarn
45+
- run: yarn install
46+
- run: yarn build
47+
- uses: paambaati/codeclimate-action@v2.5.3
48+
env:
49+
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
50+
with:
51+
coverageCommand: yarn coverage
52+
debug: true

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"scripts": {
77
"build": "tsc -p .",
88
"start": "tsc -w",
9-
"test": "jest"
9+
"test": "jest",
10+
"coverage": "jest --coverage"
1011
},
1112
"files": [
1213
"lib"

0 commit comments

Comments
 (0)