diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..9f68791 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,20 @@ +name: Linter + +on: [push, pull_request] + +jobs: + linter: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 14.x + uses: actions/setup-node@v2 + with: + node-version: '14.x' + - name: Install Dependencies + run: npm install + - name: Lint + run: | + npm run eslint + env: + CI: true \ No newline at end of file diff --git a/.github/workflows/tester.yml b/.github/workflows/tester.yml new file mode 100644 index 0000000..ea6d383 --- /dev/null +++ b/.github/workflows/tester.yml @@ -0,0 +1,46 @@ +name: Tester + +on: [push, pull_request] + +jobs: + tester: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + node-version: ['12.x', '14.x', '16.x'] + fail-fast: false + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - name: Install Dependencies + run: npm install + - name: Test + run: npm test -- --no-parallel + env: + CI: true + coverage: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + node-version: ['14.x'] + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - name: Install Dependencies + run: npm install + - name: Coverage + run: npm run test-cov + env: + CI: true + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 19e149c..ed220ca 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ tmp/ *.log .idea/ .nyc_output/ +coverage/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6dd7e87..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: node_js - -sudo: false - -cache: - apt: true - directories: - - node_modules - -node_js: - - "10" - - "12" - - "node" - -script: - - npm run eslint - - npm run test-cov - -after_script: - - npm install coveralls - - nyc report --reporter=text-lcov | coveralls - diff --git a/README.md b/README.md index d7fe9f9..c6e6817 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # hexo-pagination -[![Build Status](https://travis-ci.org/hexojs/hexo-pagination.svg?branch=master)](https://travis-ci.org/hexojs/hexo-pagination) +[![Build Status](https://github.com/hexojs/hexo-pagination/workflows/Tester/badge.svg)](https://github.com/hexojs/hexo-pagination/actions?query=workflow%3ATester) [![NPM version](https://badge.fury.io/js/hexo-pagination.svg)](https://www.npmjs.com/package/hexo-pagination) [![Coverage Status](https://img.shields.io/coveralls/hexojs/hexo-pagination.svg)](https://coveralls.io/r/hexojs/hexo-pagination?branch=master) diff --git a/package.json b/package.json index 46edddb..22d4543 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "eslint": "eslint .", "test": "mocha test/index.js", - "test-cov": "nyc npm run test" + "test-cov": "nyc --reporter=lcovonly npm run test" }, "directories": { "lib": "./lib" @@ -31,6 +31,6 @@ "nyc": "^15.0.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=12.4.0" } }