Skip to content

Commit ddfed15

Browse files
committed
ci: replace travis with GitLab CI
ci: split up CI into multiple tasks ci: replace Travis with GitLab CI
1 parent 537b8cb commit ddfed15

File tree

18 files changed

+118
-90
lines changed

18 files changed

+118
-90
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = {
1313
},
1414
"rules": {
1515
"max-len": [
16-
"error"
16+
"warn"
1717
],
1818
"indent": [
1919
"error",

.gitlab-ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
image: ubuntu:18.04
2+
3+
stages:
4+
- test
5+
- publish
6+
7+
before_script:
8+
- apt-get update -y
9+
- apt-get install curl gnupg wget -y
10+
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
11+
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
12+
- apt-get remove cmdtest
13+
- apt-get update -y
14+
- apt-get install firefox nodejs npm yarn -y
15+
- npm install -g node-gyp
16+
- npm install -g cross-env
17+
- yarn
18+
- wget https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-linux64.tar.gz
19+
- sh -c 'tar -x geckodriver -zf geckodriver-v0.23.0-linux64.tar.gz -O > /usr/bin/geckodriver'
20+
- chmod +x /usr/bin/geckodriver
21+
- rm geckodriver-v0.23.0-linux64.tar.gz
22+
23+
test:
24+
stage: test
25+
script:
26+
- yarn test
27+
28+
test-e2e:
29+
stage: test
30+
script:
31+
- yarn test:e2e
32+
33+
test-lint:
34+
stage: test
35+
script:
36+
- yarn lint
37+
38+
test-build:
39+
stage: test
40+
script:
41+
- yarn build
42+
43+
semantic-release:
44+
stage: publish
45+
script:
46+
- yarn semantic-release
47+
only:
48+
- master
49+

.travis.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
module.exports = {
22
"presets": [
33
"@babel/preset-env",
44
],
@@ -10,12 +10,6 @@
1010
"plugins": [
1111
"@babel/syntax-dynamic-import"
1212
]
13-
},
14-
"test": {
15-
"plugins": [
16-
"@babel/syntax-dynamic-import",
17-
"@babel/dynamic-import-node"
18-
]
1913
}
2014
}
2115
}

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"main": "dist/dashboard.js",
66
"module": "src/index.js",
77
"scripts": {
8-
"test": "mocha-webpack \"src/**/*.test.js\" --webpack-config webpack.test.config.js --require @babel/polyfill --reporter mochawesome",
8+
"test": "mochapack \"src/**/*.test.js\" --webpack-config webpack.test.config.js --require @babel/polyfill --reporter mochawesome",
99
"test:watch": "mocha-webpack --watch \"src/**/*.test.js\" --webpack-config webpack.test.config.js --require @babel/polyfill --reporter mochawesome",
1010
"build": "WEBPACK_ENV=build webpack",
1111
"dev": "WEBPACK_ENV=dev webpack --progress --colors --watch",
12-
"html-coverage": "cross-env NODE_ENV=test nyc --reporter=html mocha-webpack \"src/**/*.test.js\" --webpack-config webpack.test.config.js",
12+
"html-coverage": "cross-env NODE_ENV=test nyc --reporter=html mochapack \"src/**/*.test.js\" --webpack-config webpack.test.config.js",
1313
"generate-doc": "jsdoc -c jsdoc.conf.json --readme ./README.md",
1414
"lint": "eslint src",
1515
"lint:fix": "eslint src --fix",
@@ -19,7 +19,7 @@
1919
"analyze": "yarn analyze:generate && yarn analyze:tool",
2020
"manual-test": "webpack-dev-server --webpack-config webpack.test.config.js './src/manual_test.js' --hot --inline --output-filename 'test.js'",
2121
"semantic-release": "semantic-release",
22-
"test:e2e": "webpack src/manual_test.js --output-filename test.js --config webpack.config.js --mode development && mocha-webpack \"src/e2e-test.js\" --timeout 80000 --webpack-config webpack.test.config.js --require @babel/polyfill"
22+
"test:e2e": "webpack src/manual_test.js --output-filename test.js --config webpack.config.js --mode development && mochapack \"src/e2e-test.js\" --timeout 80000 --webpack-config webpack.test.config.js --require @babel/polyfill"
2323
},
2424
"keywords": [],
2525
"author": "",
@@ -38,12 +38,14 @@
3838
"@babel/cli": "^7.2.3",
3939
"@babel/core": "^7.4.0",
4040
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
41+
"@babel/plugin-transform-modules-commonjs": "^7.4.0",
4142
"@babel/polyfill": "^7.4.0",
4243
"@babel/preset-env": "^7.4.2",
4344
"@babel/register": "^7.4.0",
4445
"autoprefixer": "^9.5.0",
4546
"babel-eslint": "^10.0.1",
4647
"babel-loader": "^8.0.5",
48+
"babel-plugin-dynamic-import-node": "^2.2.0",
4749
"css-loader": "^2.1.1",
4850
"cz-conventional-changelog": "^2.1.0",
4951
"docdash": "^1.1.0",
@@ -62,7 +64,7 @@
6264
"json2yaml": "^1.1.0",
6365
"minami": "^1.2.3",
6466
"mocha": "^6.0.2",
65-
"mocha-webpack": "^2.0.0-beta.0",
67+
"mochapack": "^1.1.1",
6668
"mochawesome": "^3.1.1",
6769
"node-sass": "^4.11.0",
6870
"postcss-loader": "^3.0.0",

src/components/base/base_component.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as d3 from 'd3'
66
describe('Component', function() {
77

88
beforeEach(function () {
9-
this.jsdom = require('jsdom-global')()
9+
this.jsdom = require('jsdom-global')(undefined, {'url': 'https://fake.url.com'})
1010
})
1111

1212
afterEach(function () {

src/components/board/Board.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import assert from 'assert'
44

55
describe('Board component', function() {
66
beforeEach(function () {
7-
this.jsdom = require('jsdom-global')()
7+
this.jsdom = require('jsdom-global')(undefined, {'url': 'https://fake.url.com'})
88
})
99

1010
afterEach(function () {

src/components/chart/Chart.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const ChartComponentInjector = require('inject-loader!./Chart')
55

66
describe('ChartComponent', function() {
77
beforeEach(function () {
8-
this.jsdom = require('jsdom-global')()
8+
this.jsdom = require('jsdom-global')(undefined, {'url': 'https://fake.url.com'})
99
})
1010

1111
afterEach(function () {

src/components/columns/Columns.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import assert from 'assert'
44

55
describe('Columns component', function() {
66
beforeEach(function () {
7-
this.jsdom = require('jsdom-global')()
7+
this.jsdom = require('jsdom-global')(undefined, {'url': 'https://fake.url.com'})
88
})
99

1010
afterEach(function () {

src/components/container_base.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import sinon from 'sinon'
66

77
describe('base container component', function() {
88
beforeEach(function () {
9-
this.jsdom = require('jsdom-global')()
9+
this.jsdom = require('jsdom-global')(undefined, {'url': 'https://fake.url.com'})
1010
})
1111

1212
afterEach(function () {

0 commit comments

Comments
 (0)