From df2d28ffb177272739964eb5a503f93db870aa28 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Tue, 3 Jan 2023 18:14:21 +0800 Subject: [PATCH] test: run ci on GitHub Action (#222) --- .github/workflows/nodejs.yml | 27 +++++++++++++++++++++++++++ .travis.yml | 9 --------- Readme.md | 21 ++------------------- package.json | 4 ++-- 4 files changed, 31 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/nodejs.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000..a46f3e4 --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,27 @@ +name: Node.js CI + +on: + push: + branch: master + pull_request: + branch: master + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [8, 10, 12, 14, 16, 18] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm run lint + - run: npm run ci + - run: npx codecov diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 80b9e4a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -sudo: false -language: node_js -node_js: - - '7' - - '8' - - '10' - - '12' -script: 'npm run test-travis' -after_script: 'npm install coveralls@2 && cat ./coverage/lcov.info | coveralls' diff --git a/Readme.md b/Readme.md index b5f0561..03275e1 100644 --- a/Readme.md +++ b/Readme.md @@ -1,34 +1,17 @@ # koa-session [![NPM version][npm-image]][npm-url] -[![build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] -[![Gittip][gittip-image]][gittip-url] -[![David deps][david-image]][david-url] -[![iojs version][iojs-image]][iojs-url] -[![node version][node-image]][node-url] +[![Node.js CI](https://github.com/koajs/session/actions/workflows/nodejs.yml/badge.svg)](https://github.com/koajs/session/actions/workflows/nodejs.yml) [![npm download][download-image]][download-url] [npm-image]: https://img.shields.io/npm/v/koa-session.svg?style=flat-square [npm-url]: https://npmjs.org/package/koa-session -[travis-image]: https://img.shields.io/travis/koajs/session.svg?style=flat-square -[travis-url]: https://travis-ci.org/koajs/session -[coveralls-image]: https://img.shields.io/coveralls/koajs/session.svg?style=flat-square -[coveralls-url]: https://coveralls.io/r/koajs/session?branch=master -[gittip-image]: https://img.shields.io/gittip/fengmk2.svg?style=flat-square -[gittip-url]: https://www.gittip.com/fengmk2/ -[david-image]: https://img.shields.io/david/koajs/session.svg?style=flat-square -[david-url]: https://david-dm.org/koajs/session -[iojs-image]: https://img.shields.io/badge/io.js-%3E=_1.0-yellow.svg?style=flat-square -[iojs-url]: http://iojs.org/ -[node-image]: https://img.shields.io/badge/node.js-%3E=_7.6-green.svg?style=flat-square -[node-url]: http://nodejs.org/download/ [download-image]: https://img.shields.io/npm/dm/koa-session.svg?style=flat-square [download-url]: https://npmjs.org/package/koa-session Simple session middleware for Koa. Defaults to cookie-based sessions and supports external stores. - *Requires Node 7.6 or greater for async/await support* + *Requires Node 8.0.0 or greater for async/await support* ## Installation diff --git a/package.json b/package.json index 87249f9..3797976 100644 --- a/package.json +++ b/package.json @@ -35,12 +35,12 @@ "uuid": "^8.3.2" }, "engines": { - "node": ">=7.6" + "node": ">=8.0.0" }, "scripts": { "test": "npm run lint && NODE_ENV=test mocha --exit --require should --reporter spec test/*.test.js", "test-cov": "NODE_ENV=test node ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --exit --require should test/*.test.js", - "test-travis": "npm run lint && NODE_ENV=test node ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- --exit --require should test/*.test.js", + "ci": "npm run lint && NODE_ENV=test node ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- --exit --require should test/*.test.js", "lint": "eslint lib test index.js" } }