Skip to content

Commit 5f7464a

Browse files
authored
chore: migrate CI to github, refactore CI and npm scripts, linting fixes (#1023)
1 parent b3d9b96 commit 5f7464a

File tree

10 files changed

+71
-28
lines changed

10 files changed

+71
-28
lines changed

.github/workflows/CI.yml renamed to .github/workflows/e2e.yml

-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,5 @@ jobs:
2727
run: npm run bootstrap
2828
- name: Build
2929
run: npm run build
30-
- name: linting
31-
run: npm run lint
3230
- name: end to end
3331
run: npm run test:e2e

.github/workflows/lint.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Linting Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
pull_request:
9+
branches:
10+
- master
11+
- develop
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-16.04
16+
strategy:
17+
matrix:
18+
node-version: [10.x, 12.x, 13.x]
19+
20+
steps:
21+
- uses: actions/checkout@v1
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
- name: bootstrap
27+
run: npm run bootstrap
28+
- name: Build
29+
run: npm run build
30+
- name: Linting
31+
run: npm run lint

.github/workflows/unit.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Unit tests Suite
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
pull_request:
9+
branches:
10+
- master
11+
- develop
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-16.04
16+
strategy:
17+
matrix:
18+
node-version: [10.x, 12.x, 13.x]
19+
20+
steps:
21+
- uses: actions/checkout@v1
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
- name: bootstrap
27+
run: npm run bootstrap
28+
- name: Build
29+
run: npm run build
30+
- name: Unit tests
31+
run: npm run test

.travis.yml

-23
This file was deleted.

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
"serve:ssr": "cross-env SSR=1 node server",
2727
"dev": "run-p serve watch:*",
2828
"dev:ssr": "run-p serve:ssr watch:*",
29-
"lint": "eslint . --fix",
30-
"test": "mocha test/*/**",
29+
"lint": "eslint .",
30+
"fixlint" : "eslint . --fix",
31+
"test": "mocha ./test/**/*.test.js",
3132
"testServer": "node cypress/setup.js",
3233
"test:e2e": "start-server-and-test testServer http://localhost:3000 cy:run",
3334
"posttest:e2e": "rimraf cypress/fixtures/docs",

src/core/config.js

+4
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,19 @@ export default function () {
5858
if (config.loadSidebar === true) {
5959
config.loadSidebar = '_sidebar' + config.ext
6060
}
61+
6162
if (config.loadNavbar === true) {
6263
config.loadNavbar = '_navbar' + config.ext
6364
}
65+
6466
if (config.coverpage === true) {
6567
config.coverpage = '_coverpage' + config.ext
6668
}
69+
6770
if (config.repo === true) {
6871
config.repo = ''
6972
}
73+
7074
if (config.name === true) {
7175
config.name = ''
7276
}

src/core/render/compiler.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ export function getAndRemoveConfig(str = '') {
2222
.replace(/^'/, '')
2323
.replace(/'$/, '')
2424
.replace(/(?:^|\s):([\w-]+:?)=?([\w-]+)?/g, (m, key, value) => {
25-
if(key.indexOf(':') === -1){
25+
if (key.indexOf(':') === -1) {
2626
config[key] = (value && value.replace(/"/g, '')) || true
2727
return ''
2828
}
29+
2930
return m
3031
})
3132
.trim()
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)