From 6636e8f7cf3227e05a5b9acf1b1a0b4bd7291fb8 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Sat, 17 Dec 2022 17:16:00 +0800 Subject: [PATCH] feat: enable mochawesome by default (#193) --- .github/workflows/nodejs.yml | 51 +++++++++-------------------------- .github/workflows/release.yml | 19 +++++++++++++ README.md | 2 +- lib/cmd/test.js | 2 +- package.json | 9 ------- 5 files changed, 34 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index cab350fc..3eb06691 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -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' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..25f22d79 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 diff --git a/README.md b/README.md index 0b414965..252fc0fb 100644 --- a/README.md +++ b/README.md @@ -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 #### environment diff --git a/lib/cmd/test.js b/lib/cmd/test.js index 1c5808cc..a9d18859 100644 --- a/lib/cmd/test.js +++ b/lib/cmd/test.js @@ -64,7 +64,7 @@ class TestCommand extends Command { mochawesome: { type: 'boolean', description: 'enable mochawesome reporter', - default: false, + default: true, }, }; } diff --git a/package.json b/package.json index 773b60f9..a982014b 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,6 @@ }, "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", @@ -57,7 +56,6 @@ "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", @@ -94,12 +92,5 @@ }, "engines": { "node": ">= 14.0.0" - }, - "ci": { - "version": "14, 16, 18", - "os": "linux, macos", - "license": { - "year": "2017" - } } }