diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 00000000..9ea8903c --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,81 @@ +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: Checkout submodules + run: git submodule update --init + - name: Install Node.js + uses: actions/setup-node@v1 + with: + node-version: 12 + - name: Install Packages + run: npm install + - name: Lint + run: npm run -s lint + + test: + name: Test + + strategy: + matrix: + eslint: [6, 5] + node: [13, 12, 10, 8, "8.10.0"] + exclude: + # Run ESLint 5 on only the LTS. + - node: 13 + eslint: 5 + - node: 10 + eslint: 5 + - node: 8 + eslint: 5 + - node: "8.10.0" + eslint: 5 + + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: Checkout submodules + run: git submodule update --init + - name: Install Node.js v${{ matrix.node }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - name: Install Packages + run: npm install + - name: Install ESLint v${{ matrix.eslint }} + run: | + if [ ${{ matrix.eslint }} -eq 6 ]; then + cd test/fixtures/eslint + npm install + else + npm install --no-save eslint@5.16.0 + cd test/fixtures/eslint + git checkout v5.16.0 + npm install eslint-utils@1.4.0 + npm install + fi + - 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/.travis.yml b/.travis.yml deleted file mode 100644 index d1f6ef72..00000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -sudo: false - -language: node_js -matrix: - include: - - node_js: "6.5" - env: ESLINT=5 - - node_js: "8" - env: ESLINT=5 - - node_js: "8" - env: ESLINT=6 - - node_js: "10" - env: ESLINT=5 - - node_js: "10" - env: ESLINT=6 - - node_js: "11" - -before_install: - - if [ "$ESLINT" = "6" ]; then npm i -D eslint@6.0.0; fi - - if [ "$ESLINT" = "6" ]; then npm i -S espree@6.0.0 eslint-scope@5.0.0; fi - - if [ "$ESLINT" = "5" ]; then npm i -D eslint@5.16.0 @mysticatea/eslint-plugin@9.0.1; fi - - if [ "$ESLINT" = "5" ]; then npm i -S espree@5.0.0 eslint-scope@4.0.0; fi - -before_script: - - npm run setup - -after_success: - - npm run codecov diff --git a/README.md b/README.md index ce9881ed..f4b28224 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [](https://www.npmjs.com/package/vue-eslint-parser) [](http://www.npmtrends.com/vue-eslint-parser) -[](https://travis-ci.org/mysticatea/vue-eslint-parser) +[](https://github.com/mysticatea/vue-eslint-parser/actions) [](https://codecov.io/gh/mysticatea/vue-eslint-parser) [](https://david-dm.org/mysticatea/vue-eslint-parser) diff --git a/package.json b/package.json index b80066de..ef68abda 100644 --- a/package.json +++ b/package.json @@ -3,20 +3,20 @@ "version": "6.0.5", "description": "The ESLint custom parser for `.vue` files.", "engines": { - "node": ">=6.5" + "node": ">=8.10" }, "main": "index.js", "files": [ "index.*" ], "peerDependencies": { - "eslint": "^5.0.0 || ^6.0.0" + "eslint": ">=5.0.0" }, "dependencies": { "debug": "^4.1.1", - "eslint-scope": "^4.0.0 || ^5.0.0", - "eslint-visitor-keys": "^1.0.0", - "espree": "^5.0.0 || ^6.0.0", + "eslint-scope": "^5.0.0", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", "esquery": "^1.0.1", "lodash": "^4.17.15" }, @@ -57,7 +57,8 @@ "lint": "node -e \"if(process.env.ESLINT=='5')process.exit(1)\" && eslint src test --ext .js,.ts || node -e \"if(process.env.ESLINT!='5')process.exit(1)\"", "setup": "git submodule update --init && cd test/fixtures/eslint && npm install", "pretest": "run-s build lint", - "test": "nyc mocha \"test/*.js\" --reporter dot --timeout 10000", + "test": "npm run -s test:mocha", + "test:mocha": "nyc mocha \"test/*.js\" --reporter dot --timeout 10000", "preupdate-fixtures": "npm run -s build", "update-fixtures": "node scripts/update-fixtures-ast.js", "preversion": "npm test",