From 9cce60c33d0356465c0dc7b2c3544cb21c38c549 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Wed, 5 Jun 2024 13:38:34 +0800 Subject: [PATCH] test: run test on github action (#86) --- .autod.conf.js | 18 ------------------ .github/workflows/node.yml | 17 +++++++++++++++++ .travis.yml | 7 ------- LICENSE.md => LICENSE.txt | 0 Readme.md | 17 ++++++----------- package.json | 10 ++++++---- 6 files changed, 29 insertions(+), 40 deletions(-) delete mode 100644 .autod.conf.js create mode 100644 .github/workflows/node.yml delete mode 100644 .travis.yml rename LICENSE.md => LICENSE.txt (100%) diff --git a/.autod.conf.js b/.autod.conf.js deleted file mode 100644 index 48564fc..0000000 --- a/.autod.conf.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -module.exports = { - write: true, - prefix: '^', - devprefix: '^', - exclude: [], - devdep: [ - 'autod', - 'eslint', - 'eslint-config-egg', - 'egg-bin', - ], - dep: [], - semver: [ - 'koa@1', - ], -}; diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml new file mode 100644 index 0000000..a59ba46 --- /dev/null +++ b/.github/workflows/node.yml @@ -0,0 +1,17 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + Job: + name: Node.js + uses: node-modules/github-actions/.github/workflows/node-test.yml@master + with: + os: 'ubuntu-latest' + version: '8, 10, 12, 14, 16, 18, 20, 22' + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c2644a2..0000000 --- a/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -sudo: false -language: node_js -node_js: - - "8" - - "10" -script: "npm run cov" -after_script: "npm install codecov && codecov" diff --git a/LICENSE.md b/LICENSE.txt similarity index 100% rename from LICENSE.md rename to LICENSE.txt diff --git a/Readme.md b/Readme.md index 66731ce..1ef6793 100644 --- a/Readme.md +++ b/Readme.md @@ -1,23 +1,18 @@ # co-body [![NPM version][npm-image]][npm-url] -[![build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] -[![David deps][david-image]][david-url] +[![CI](https://github.com/cojs/co-body/actions/workflows/node.yml/badge.svg)](https://github.com/cojs/co-body/actions/workflows/node.yml) +[![Test coverage][codecov-image]][codecov-url] [![npm download][download-image]][download-url] [npm-image]: https://img.shields.io/npm/v/co-body.svg?style=flat-square [npm-url]: https://npmjs.org/package/co-body -[travis-image]: https://img.shields.io/travis/cojs/co-body.svg?style=flat-square -[travis-url]: https://travis-ci.org/cojs/co-body -[coveralls-image]: https://img.shields.io/coveralls/cojs/co-body.svg?style=flat-square -[coveralls-url]: https://coveralls.io/r/cojs/co-body?branch=master -[david-image]: https://img.shields.io/david/cojs/co-body.svg?style=flat-square -[david-url]: https://david-dm.org/cojs/co-body +[codecov-image]: https://codecov.io/github/cojs/co-body/coverage.svg?branch=master +[codecov-url]: https://codecov.io/github/cojs/co-body?branch=master [download-image]: https://img.shields.io/npm/dm/co-body.svg?style=flat-square [download-url]: https://npmjs.org/package/co-body - Parse request bodies with generators inspired by [Raynos/body](https://github.com/Raynos/body). +> Parse request bodies with generators inspired by [Raynos/body](https://github.com/Raynos/body). ## Installation @@ -80,4 +75,4 @@ var body = await parse(this); # License - MIT +[MIT](LICENSE.txt) diff --git a/package.json b/package.json index 31baafc..cd56bd4 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "type-is": "^1.6.16" }, "devDependencies": { - "autod": "^3.0.1", "egg-bin": "^4.7.0", "eslint": "^4.19.1", "eslint-config-egg": "^7.0.0", @@ -31,12 +30,15 @@ "license": "MIT", "scripts": { "lint": "eslint .", - "autod": "autod", "test": "egg-bin test -r should", - "cov": "eslint . && egg-bin cov -r should" + "cov": "eslint . && egg-bin cov -r should", + "ci": "npm run lint && npm run cov" }, "files": [ "index.js", "lib/" - ] + ], + "engines": { + "node": ">=8.0.0" + } }