From 00ca02d89ac04619e5894589eef0db588316a5ef Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Sat, 9 Nov 2019 21:35:14 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=92=A5=20drop=20Node.js=206=20and=20s?= =?UTF-8?q?witch=20CI=20to=20GitHub=20Actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CI.yml | 76 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 28 --------------- README.md | 2 +- package.json | 13 +++---- 4 files changed, 84 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/CI.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 00000000..4fc50530 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,76 @@ +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: npm run -s lint + + test: + name: Test + + strategy: + matrix: + node: [13, 12, 10, 8, "8.10.0"] + eslint: [6, 5] + 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: 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: | + git submodule update --init + if [ ${{ matrix.eslint }} -eq 6 ]; then + cd test/fixtures/eslint + else + npm install --no-save eslint@^${{ matrix.eslint }} + cd test/fixtures/eslint + git checkout v5.16.0 + fi + 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/.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 @@ [![npm version](https://img.shields.io/npm/v/vue-eslint-parser.svg)](https://www.npmjs.com/package/vue-eslint-parser) [![Downloads/month](https://img.shields.io/npm/dm/vue-eslint-parser.svg)](http://www.npmtrends.com/vue-eslint-parser) -[![Build Status](https://travis-ci.org/mysticatea/vue-eslint-parser.svg?branch=master)](https://travis-ci.org/mysticatea/vue-eslint-parser) +[![Build Status](https://github.com/mysticatea/vue-eslint-parser/workflows/CI/badge.svg)](https://github.com/mysticatea/vue-eslint-parser/actions) [![Coverage Status](https://codecov.io/gh/mysticatea/vue-eslint-parser/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/vue-eslint-parser) [![Dependency Status](https://david-dm.org/mysticatea/vue-eslint-parser.svg)](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", From 6de56fec2c6e68775c59312f74ff4db3611731f1 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Sat, 9 Nov 2019 21:47:24 +0900 Subject: [PATCH 2/5] fix about submodules --- .github/workflows/CI.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 4fc50530..c7f96b10 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -16,6 +16,7 @@ jobs: uses: actions/checkout@v1 with: fetch-depth: 1 + submodules: true - name: Install Node.js uses: actions/setup-node@v1 with: @@ -49,6 +50,7 @@ jobs: uses: actions/checkout@v1 with: fetch-depth: 1 + submodules: true - name: Install Node.js v${{ matrix.node }} uses: actions/setup-node@v1 with: @@ -57,11 +59,10 @@ jobs: run: npm install - name: Install ESLint v${{ matrix.eslint }} run: | - git submodule update --init if [ ${{ matrix.eslint }} -eq 6 ]; then cd test/fixtures/eslint else - npm install --no-save eslint@^${{ matrix.eslint }} + npm install --no-save eslint@5.16.0 cd test/fixtures/eslint git checkout v5.16.0 fi From 83d2f0d683e3d78a0c693c31cede3db123aee20d Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Sat, 9 Nov 2019 21:47:45 +0900 Subject: [PATCH 3/5] reorder --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c7f96b10..d8ae1a17 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -31,8 +31,8 @@ jobs: strategy: matrix: - node: [13, 12, 10, 8, "8.10.0"] eslint: [6, 5] + node: [13, 12, 10, 8, "8.10.0"] exclude: # Run ESLint 5 on only the LTS. - node: 13 From 77e80f44ddffb55e356b8e6cf2a8197359d6b356 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Sat, 9 Nov 2019 21:51:22 +0900 Subject: [PATCH 4/5] fix for failing on ESLint 5 --- .github/workflows/CI.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d8ae1a17..d8986d68 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -61,12 +61,14 @@ jobs: 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 - npm install - name: Build run: npm run -s build - name: Test From 70ce11cc00dd8ac29937a6735f3434f0d0b4711f Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Sat, 9 Nov 2019 21:57:27 +0900 Subject: [PATCH 5/5] submodules option of actions/checkout didn't work :( --- .github/workflows/CI.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d8986d68..9ea8903c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -16,7 +16,8 @@ jobs: uses: actions/checkout@v1 with: fetch-depth: 1 - submodules: true + - name: Checkout submodules + run: git submodule update --init - name: Install Node.js uses: actions/setup-node@v1 with: @@ -50,7 +51,8 @@ jobs: uses: actions/checkout@v1 with: fetch-depth: 1 - submodules: true + - name: Checkout submodules + run: git submodule update --init - name: Install Node.js v${{ matrix.node }} uses: actions/setup-node@v1 with: