mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
chore: migrate CI to github, refactore CI and npm scripts, linting fixes (#1023)
This commit is contained in:
parent
b3d9b966df
commit
5f7464af48
@ -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
.github/workflows/lint.yml
vendored
Normal file
31
.github/workflows/lint.yml
vendored
Normal file
@ -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
.github/workflows/unit.yml
vendored
Normal file
31
.github/workflows/unit.yml
vendored
Normal file
@ -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
.travis.yml
23
.travis.yml
@ -1,23 +0,0 @@
|
||||
sudo: false
|
||||
language: node_js
|
||||
node_js: stable
|
||||
node_js:
|
||||
- '10'
|
||||
- '8'
|
||||
- '12'
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
before_install:
|
||||
- npm update
|
||||
install:
|
||||
- npm install
|
||||
script:
|
||||
- npm run build
|
||||
- npm run test:e2e
|
||||
script:
|
||||
- npm run lint
|
||||
@ -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",
|
||||
|
||||
@ -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 = ''
|
||||
}
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user