Skip to content

Commit

Permalink
chore: migrate CI to github, refactore CI and npm scripts, linting fi…
Browse files Browse the repository at this point in the history
  • Loading branch information
anikethsaha authored Feb 14, 2020
1 parent b3d9b96 commit 5f7464a
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 28 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/CI.yml → .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,5 @@ jobs:
run: npm run bootstrap
- name: Build
run: npm run build
- name: linting
run: npm run lint
- name: end to end
run: npm run test:e2e
31 changes: 31 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Linting Checks

on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop

jobs:
build:
runs-on: ubuntu-16.04
strategy:
matrix:
node-version: [10.x, 12.x, 13.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: bootstrap
run: npm run bootstrap
- name: Build
run: npm run build
- name: Linting
run: npm run lint
31 changes: 31 additions & 0 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Unit tests Suite

on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop

jobs:
build:
runs-on: ubuntu-16.04
strategy:
matrix:
node-version: [10.x, 12.x, 13.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: bootstrap
run: npm run bootstrap
- name: Build
run: npm run build
- name: Unit tests
run: npm run test
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
"serve:ssr": "cross-env SSR=1 node server",
"dev": "run-p serve watch:*",
"dev:ssr": "run-p serve:ssr watch:*",
"lint": "eslint . --fix",
"test": "mocha test/*/**",
"lint": "eslint .",
"fixlint" : "eslint . --fix",
"test": "mocha ./test/**/*.test.js",
"testServer": "node cypress/setup.js",
"test:e2e": "start-server-and-test testServer http://localhost:3000 cy:run",
"posttest:e2e": "rimraf cypress/fixtures/docs",
Expand Down
4 changes: 4 additions & 0 deletions src/core/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,19 @@ export default function () {
if (config.loadSidebar === true) {
config.loadSidebar = '_sidebar' + config.ext
}

if (config.loadNavbar === true) {
config.loadNavbar = '_navbar' + config.ext
}

if (config.coverpage === true) {
config.coverpage = '_coverpage' + config.ext
}

if (config.repo === true) {
config.repo = ''
}

if (config.name === true) {
config.name = ''
}
Expand Down
3 changes: 2 additions & 1 deletion src/core/render/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ export function getAndRemoveConfig(str = '') {
.replace(/^'/, '')
.replace(/'$/, '')
.replace(/(?:^|\s):([\w-]+:?)=?([\w-]+)?/g, (m, key, value) => {
if(key.indexOf(':') === -1){
if (key.indexOf(':') === -1) {
config[key] = (value && value.replace(/"/g, '')) || true
return ''
}

return m
})
.trim()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 5f7464a

Please sign in to comment.