Skip to content

Commit

Permalink
feat: enable mochawesome by default (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 authored Dec 17, 2022
1 parent 0bad137 commit 6636e8f
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 49 deletions.
51 changes: 13 additions & 38 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,21 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI
name: CI

on:
push:
branches:
- main
- master
branches: [ master, main ]

pull_request:
branches:
- main
- master
branches: [ master, main, next, beta, '*.x' ]

schedule:
- cron: '0 2 * * *'

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node-version: [14, 16, 18]
os: [ubuntu-latest, macos-latest]
workflow_dispatch: {}

steps:
- name: Checkout Git Source
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm i

- name: Continuous Integration
run: npm run ci

- name: Code Coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
jobs:
Job:
name: Node.js
uses: artusjs/github-actions/.github/workflows/node-test.yml@v1
with:
os: 'ubuntu-latest, macos-latest'
version: '14, 16, 18'
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release
on:
# 合并后自动发布
push:
branches: [ master ]

# 手动发布
workflow_dispatch: {}

jobs:
release:
name: Node.js
uses: artusjs/github-actions/.github/workflows/node-release.yml@v1
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
with:
checkTest: false
# dryRun: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ You can pass any mocha argv.
- `--parallel` enable mocha parallel mode, default to `false`.
- `--auto-agent` auto start agent in mocha master agent.
- `--jobs` number of jobs to run in parallel, default to `os.cpus().length - 1`.
- `--mochawesome` enable [mochawesome](https://github.com/adamgruber/mochawesome) reporter, default to `false`.
- `--mochawesome` enable [mochawesome](https://github.com/adamgruber/mochawesome) reporter, default to `true`.
- see more at <https://mochajs.org/#usage>

#### environment
Expand Down
2 changes: 1 addition & 1 deletion lib/cmd/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class TestCommand extends Command {
mochawesome: {
type: 'boolean',
description: 'enable mochawesome reporter',
default: false,
default: true,
},
};
}
Expand Down
9 changes: 0 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,13 @@
},
"devDependencies": {
"@types/mocha": "^9.1.1",
"autod": "^3.1.2",
"babel": "^6.3.26",
"babel-preset-airbnb": "^1.0.1",
"babel-register": "^6.4.3",
"coffee": "^5.4.0",
"cpy": "^8.1.2",
"cross-env": "^3.1.3",
"egg": "^2.35.0",
"egg-ci": "^2.1.0",
"egg-mock": "^5.0.2",
"enzyme": "^2.0.0",
"esbuild-register": "^2.5.0",
Expand Down Expand Up @@ -94,12 +92,5 @@
},
"engines": {
"node": ">= 14.0.0"
},
"ci": {
"version": "14, 16, 18",
"os": "linux, macos",
"license": {
"year": "2017"
}
}
}

0 comments on commit 6636e8f

Please sign in to comment.