From f1c8d02b3fd190a97e39603929c0aabe36c9904f Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Sun, 20 Oct 2019 19:48:21 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9A=92=20update=20build=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .codecov.yml | 1 + .eslintignore | 6 ++++- .github/workflows/CI.yml | 52 ++++++++++++++++++++++++++++++++++++++++ .nycrc | 4 ++-- .travis.yml | 26 -------------------- README.md | 10 ++++---- docs/.vuepress/config.js | 4 ---- package.json | 9 +++---- 8 files changed, 70 insertions(+), 42 deletions(-) create mode 100644 .codecov.yml create mode 100644 .github/workflows/CI.yml delete mode 100644 .travis.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..db24720 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1 @@ +comment: off diff --git a/.eslintignore b/.eslintignore index 17fa7eb..d23f4fb 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,8 @@ -/docs/.vuepress/dist +/.nyc_output +/coverage /node_modules /index.* +/test.* + !.vuepress +/docs/.vuepress/dist diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..9ff8c1a --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,52 @@ +name: CI +on: + push: + branches: [master] + pull_request: + branches: [master] + schedule: + - cron: 0 0 * * 0 + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: Install Node.js + uses: actions/setup-node@v1 + with: + node-version: 12 + - name: Install Packages + run: npm install + - name: Lint + run: node run -s lint + + test: + name: Test + strategy: + matrix: + node: [12, 10, 8, 6] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: Install Node.js ${{ matrix.node }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - name: Install Packages + run: npm install + - name: Build + run: npm run -s build + - name: Test + run: npm run -s test:mocha + - name: Send Coverage + run: npm run -s codecov + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.nycrc b/.nycrc index 9992db5..9ca13b9 100644 --- a/.nycrc +++ b/.nycrc @@ -1,5 +1,5 @@ { "include": ["src/**/*.js"], - "require": ["esm"], - "cache": true + "reporter": ["lcov", "text-summary"], + "require": ["esm"] } diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2ad59ed..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -sudo: false - -language: node_js -node_js: - - 6.5.0 - - 8 - - 10 - -script: - - npm test - -after_success: - - npm run -s codecov - -before_deploy: - - npm run -s docs:build - -deploy: - provider: pages - skip-cleanup: true - github-token: $ATOKEN - keep-history: true - local-dir: docs/.vuepress/dist - on: - branch: master - node: 10 diff --git a/README.md b/README.md index 7069f04..0358380 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![npm version](https://img.shields.io/npm/v/eslint-utils.svg)](https://www.npmjs.com/package/eslint-utils) [![Downloads/month](https://img.shields.io/npm/dm/eslint-utils.svg)](http://www.npmtrends.com/eslint-utils) -[![Build Status](https://travis-ci.org/mysticatea/eslint-utils.svg?branch=master)](https://travis-ci.org/mysticatea/eslint-utils) +[![Build Status](https://github.com/mysticatea/eslint-utils/workflows/CI/badge.svg)](https://github.com/mysticatea/eslint-utils/actions) [![Coverage Status](https://codecov.io/gh/mysticatea/eslint-utils/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/eslint-utils) [![Dependency Status](https://david-dm.org/mysticatea/eslint-utils.svg)](https://david-dm.org/mysticatea/eslint-utils) @@ -12,13 +12,13 @@ This package provides utility functions and classes for make ESLint custom rules For examples: -- [getStaticValue](https://mysticatea.github.io/eslint-utils/api/ast-utils.html#getstaticvalue) evaluates static value on AST. -- [PatternMatcher](https://mysticatea.github.io/eslint-utils/api/ast-utils.html#patternmatcher-class) finds a regular expression pattern as handling escape sequences. -- [ReferenceTracker](https://mysticatea.github.io/eslint-utils/api/scope-utils.html#referencetracker-class) checks the members of modules/globals as handling assignments and destructuring. +- [getStaticValue](https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstaticvalue) evaluates static value on AST. +- [PatternMatcher](https://eslint-utils.mysticatea.dev/api/ast-utils.html#patternmatcher-class) finds a regular expression pattern as handling escape sequences. +- [ReferenceTracker](https://eslint-utils.mysticatea.dev/api/scope-utils.html#referencetracker-class) checks the members of modules/globals as handling assignments and destructuring. ## 📖 Usage -See [documentation](https://mysticatea.github.io/eslint-utils/). +See [documentation](https://eslint-utils.mysticatea.dev/). ## 📰 Changelog diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 01cf0a4..f33f588 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,11 +1,7 @@ -"use strict" - module.exports = { - base: "/eslint-utils/", title: "eslint-utils", description: "Utilities for ESLint plugins and custom rules.", serviceWorker: true, - ga: "UA-12936571-6", themeConfig: { repo: "mysticatea/eslint-utils", diff --git a/package.json b/package.json index 4607e38..e92523c 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "esm": "^3.0.55", "espree": "^5.0.1", "mocha": "^5.2.0", + "npm-run-all": "^4.1.5", "nyc": "^13.0.1", "opener": "^1.4.3", "rimraf": "^2.6.2", @@ -35,16 +36,16 @@ "build": "rollup -c", "clean": "rimraf .nyc_output coverage index.*", "codecov": "nyc report -r lcovonly && codecov", - "coverage": "nyc report -r lcov && opener ./coverage/lcov-report/index.html", + "coverage": "opener ./coverage/lcov-report/index.html", "docs:build": "vuepress build docs", "docs:watch": "vuepress dev docs", "lint": "eslint src test", - "pretest": "npm run -s lint && npm run -s build", - "test": "nyc mocha --reporter dot \"test/*.js\"", + "test": "run-s lint build test:mocha", + "test:mocha": "nyc mocha --reporter dot \"test/*.js\"", "preversion": "npm test && npm run -s build", "postversion": "git push && git push --tags", "prewatch": "npm run -s clean", - "watch": "warun \"{src,test}/**/*.js\" -- nyc --reporter lcov mocha --reporter dot \"test/*.js\"" + "watch": "warun \"{src,test}/**/*.js\" -- npm run -s test:mocha" }, "repository": { "type": "git",