Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable mochawesome by default #193

Merged
merged 2 commits into from
Dec 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@atian25 继续尝试

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"
}
}
}