Skip to content

Commit 2459d45

Browse files
committed
Add Github actions to run tests on CI
1 parent 4d008ac commit 2459d45

File tree

3 files changed

+40
-15
lines changed

3 files changed

+40
-15
lines changed

.github/workflows/ci-tests.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: ci_tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
push:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v1
14+
- uses: actions/setup-node@v1
15+
with:
16+
node-version: 12
17+
- name: Cache node modules
18+
uses: actions/cache@v1
19+
with:
20+
path: node_modules
21+
key: dependencies
22+
- run: npm i
23+
- run: npm run lint
24+
- run: npm run test
25+

package-lock.json

+10-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "react-json-view",
3-
"description":
4-
"Interactive react component for displaying javascript arrays and JSON objects.",
3+
"description": "Interactive react component for displaying javascript arrays and JSON objects.",
54
"version": "1.19.1",
65
"main": "dist/main.js",
76
"dependencies": {
@@ -56,17 +55,13 @@
5655
"react-dom": "^16.0.0 || ^15.5.4"
5756
},
5857
"scripts": {
59-
"build":
60-
"webpack --config webpack/webpack.config.js -p --display-error-details --progress --optimize-minimize",
58+
"build": "webpack --config webpack/webpack.config.js -p --display-error-details --progress --optimize-minimize",
6159
"prebuild": "npm run test:unit",
62-
"build:demo":
63-
"webpack --config webpack/webpack.config-demo.js -p --display-error-details --progress --optimize-minimize",
64-
"dev":
65-
"webpack-dev-server --config webpack/webpack.config-dev.js --open",
60+
"build:demo": "webpack --config webpack/webpack.config-demo.js -p --display-error-details --progress --optimize-minimize",
61+
"dev": "webpack-dev-server --config webpack/webpack.config-dev.js --open",
6662
"modules:debug": "./docker/debug.sh",
6763
"modules:tree": "webpack --config webpack/webpack.config.js --json ",
68-
"modules:size-analyzer":
69-
"webpack --config webpack/webpack.config.js --json | webpack-bundle-size-analyzer",
64+
"modules:size-analyzer": "webpack --config webpack/webpack.config.js --json | webpack-bundle-size-analyzer",
7065
"test": "npm run test:unit && npm run test:coverage",
7166
"test:unit": "nyc mocha test/**/*-test.js",
7267
"test:coverage": "nyc report --reporter=text-lcov | coveralls",

0 commit comments

Comments
 (0)