From d4ee513ff7f5c278fe40cab9a144013e90a00bed Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Sat, 17 Dec 2022 19:26:00 +0800 Subject: [PATCH] Revert "feat: enable mochawesome by default (#193)" This reverts commit 6636e8f7cf3227e05a5b9acf1b1a0b4bd7291fb8. --- .github/workflows/nodejs.yml | 51 ++++++++++++++++++++++++++--------- .github/workflows/release.yml | 19 ------------- README.md | 2 +- lib/cmd/test.js | 2 +- package.json | 9 +++++++ 5 files changed, 49 insertions(+), 34 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 3eb06691..cab350fc 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -1,21 +1,46 @@ -name: CI +# 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 on: push: - branches: [ master, main ] - + branches: + - main + - master pull_request: - branches: [ master, main, next, beta, '*.x' ] - + branches: + - main + - master schedule: - cron: '0 2 * * *' - workflow_dispatch: {} - 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' + build: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + node-version: [14, 16, 18] + os: [ubuntu-latest, macos-latest] + + 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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 25f22d79..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,19 +0,0 @@ -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 252fc0fb..0b414965 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 `true`. +- `--mochawesome` enable [mochawesome](https://github.com/adamgruber/mochawesome) reporter, default to `false`. - see more at #### environment diff --git a/lib/cmd/test.js b/lib/cmd/test.js index a9d18859..1c5808cc 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: true, + default: false, }, }; } diff --git a/package.json b/package.json index 3d86b0ad..39207116 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ }, "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", @@ -56,6 +57,7 @@ "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", @@ -92,5 +94,12 @@ }, "engines": { "node": ">= 14.0.0" + }, + "ci": { + "version": "14, 16, 18", + "os": "linux, macos", + "license": { + "year": "2017" + } } }