From 050b59e03e13537a8ed69cd64ce7f4bc24d5e6fd Mon Sep 17 00:00:00 2001 From: Pelle Wessman Date: Sat, 25 Jan 2020 16:48:12 +0100 Subject: [PATCH 01/18] Add GitHub CI tasks --- .github/workflows/other.yml | 23 +++++++++++++++++++++++ .github/workflows/test.yml | 30 ++++++++++++++++++++++++++++++ package.json | 3 ++- 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/other.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/other.yml b/.github/workflows/other.yml new file mode 100644 index 0000000000..53648f78cc --- /dev/null +++ b/.github/workflows/other.yml @@ -0,0 +1,23 @@ +name: Other + +on: [push] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm install + - run: npm run lint + integration: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm install + - run: npm run integration diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000000..98279b6b45 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,30 @@ +name: Tests + +on: [push] + +jobs: + test: + name: Node.js ${{ matrix.node_version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + node_version: + - 12 + - 10 + os: + - ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node_version }} + - run: npm install + - run: npm run test-coverage + - uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + parallel: true + - uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + parallel-finished: true diff --git a/package.json b/package.json index afeea703b6..1cc541ae2f 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ }, "scripts": { "test": "xo && nyc ava", - "lint": "node ./test/lint/lint.js", + "test-coverage": "nyc --reporter=lcov ava", + "lint": "node ./test/lint/lint.js && xo", "integration": "node ./test/integration/test.js" }, "files": [ From eb961c1a6eefb8765527ebc74c45980a325d821f Mon Sep 17 00:00:00 2001 From: Pelle Wessman Date: Sat, 25 Jan 2020 17:01:34 +0100 Subject: [PATCH 02/18] Test on Windows as well --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 98279b6b45..9387bdbb74 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,6 +13,7 @@ jobs: - 10 os: - ubuntu-latest + - windows-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 From efde3b62d34d671aead8a077aa9a607ca65e6d09 Mon Sep 17 00:00:00 2001 From: Pelle Wessman Date: Sat, 1 Feb 2020 16:17:45 +0100 Subject: [PATCH 03/18] Test on Node 13 as well --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9387bdbb74..223c9da9de 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,6 +9,7 @@ jobs: strategy: matrix: node_version: + - 13 - 12 - 10 os: From 2d81a5c0dd90a58a6a97ce31a5a296b904e78708 Mon Sep 17 00:00:00 2001 From: Pelle Wessman Date: Sat, 1 Feb 2020 16:03:33 +0100 Subject: [PATCH 04/18] Remove travis file and replace badges --- .travis.yml | 18 ------------------ readme.md | 3 ++- 2 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 895f1970dd..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: node_js -node_js: - - '12' - - '10' -cache: - npm: false -matrix: - include: - - node_js: '12' - env: INTEGRATION=true SKIP_TEST=true - - node_js: '12' - env: LINT=true SKIP_TEST=true -script: - - if [[ $INTEGRATION == true ]]; then npm run integration; fi - - if [[ $LINT == true ]]; then npm run lint; fi - - if [[ $SKIP_TEST != true ]]; then npm test; fi -after_success: - - if [[ $SKIP_TEST != true ]]; then ./node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls; fi diff --git a/readme.md b/readme.md index d76c5830dc..891b573f65 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,5 @@ -# eslint-plugin-unicorn [![Build Status](https://travis-ci.org/sindresorhus/eslint-plugin-unicorn.svg?branch=master)](https://travis-ci.org/sindresorhus/eslint-plugin-unicorn) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/eslint-plugin-unicorn/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/eslint-plugin-unicorn?branch=master) +# eslint-plugin-unicorn ![Tests](https://github.com/sindresorhus/eslint-plugin-unicorn/workflows/Tests/badge.svg) +![Other](https://github.com/sindresorhus/eslint-plugin-unicorn/workflows/Other/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/eslint-plugin-unicorn/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/eslint-plugin-unicorn?branch=master) From 1e094d027612121d9e422798994dfe5126a255cc Mon Sep 17 00:00:00 2001 From: Pelle Wessman Date: Sat, 1 Feb 2020 16:41:25 +0100 Subject: [PATCH 05/18] Add suggested `continue-on-error: true` --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 223c9da9de..b1fd1f046a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,10 +23,12 @@ jobs: - run: npm install - run: npm run test-coverage - uses: coverallsapp/github-action@master + continue-on-error: true with: github-token: ${{ secrets.github_token }} parallel: true - uses: coverallsapp/github-action@master + continue-on-error: true with: github-token: ${{ secrets.github_token }} parallel-finished: true From 7487064d39a2ffdcd6275f218c62c5056cfd5697 Mon Sep 17 00:00:00 2001 From: Pelle Wessman Date: Sat, 1 Feb 2020 16:44:04 +0100 Subject: [PATCH 06/18] Add pull_request event --- .github/workflows/other.yml | 4 +++- .github/workflows/test.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/other.yml b/.github/workflows/other.yml index 53648f78cc..96bcacdded 100644 --- a/.github/workflows/other.yml +++ b/.github/workflows/other.yml @@ -1,6 +1,8 @@ name: Other -on: [push] +on: + - push + - pull_request jobs: lint: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b1fd1f046a..708ecf7cf8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,8 @@ name: Tests -on: [push] +on: + - push + - pull_request jobs: test: From c7ffbd332bf764f75414410da45bcb09730f7b30 Mon Sep 17 00:00:00 2001 From: Pelle Wessman Date: Sat, 1 Feb 2020 16:45:04 +0100 Subject: [PATCH 07/18] Remove accidental line break in README --- readme.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 891b573f65..56ae608792 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,4 @@ -# eslint-plugin-unicorn ![Tests](https://github.com/sindresorhus/eslint-plugin-unicorn/workflows/Tests/badge.svg) -![Other](https://github.com/sindresorhus/eslint-plugin-unicorn/workflows/Other/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/eslint-plugin-unicorn/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/eslint-plugin-unicorn?branch=master) +# eslint-plugin-unicorn ![Tests](https://github.com/sindresorhus/eslint-plugin-unicorn/workflows/Tests/badge.svg) ![Other](https://github.com/sindresorhus/eslint-plugin-unicorn/workflows/Other/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/eslint-plugin-unicorn/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/eslint-plugin-unicorn?branch=master) From 394da1ad2680e3c2f92237803f79bdf34277fc9f Mon Sep 17 00:00:00 2001 From: fisker Date: Tue, 11 Feb 2020 12:00:51 +0800 Subject: [PATCH 08/18] Merge tasks --- .github/workflows/other.yml | 25 ------------------------- .github/workflows/test.yml | 36 ------------------------------------ package.json | 3 +-- readme.md | 2 +- 4 files changed, 2 insertions(+), 64 deletions(-) delete mode 100644 .github/workflows/other.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/other.yml b/.github/workflows/other.yml deleted file mode 100644 index 96bcacdded..0000000000 --- a/.github/workflows/other.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Other - -on: - - push - - pull_request - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 12 - - run: npm install - - run: npm run lint - integration: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 12 - - run: npm install - - run: npm run integration diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 708ecf7cf8..0000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Tests - -on: - - push - - pull_request - -jobs: - test: - name: Node.js ${{ matrix.node_version }} on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - node_version: - - 13 - - 12 - - 10 - os: - - ubuntu-latest - - windows-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node_version }} - - run: npm install - - run: npm run test-coverage - - uses: coverallsapp/github-action@master - continue-on-error: true - with: - github-token: ${{ secrets.github_token }} - parallel: true - - uses: coverallsapp/github-action@master - continue-on-error: true - with: - github-token: ${{ secrets.github_token }} - parallel-finished: true diff --git a/package.json b/package.json index 1cc541ae2f..afeea703b6 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,7 @@ }, "scripts": { "test": "xo && nyc ava", - "test-coverage": "nyc --reporter=lcov ava", - "lint": "node ./test/lint/lint.js && xo", + "lint": "node ./test/lint/lint.js", "integration": "node ./test/integration/test.js" }, "files": [ diff --git a/readme.md b/readme.md index 56ae608792..55bfdaf509 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# eslint-plugin-unicorn ![Tests](https://github.com/sindresorhus/eslint-plugin-unicorn/workflows/Tests/badge.svg) ![Other](https://github.com/sindresorhus/eslint-plugin-unicorn/workflows/Other/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/eslint-plugin-unicorn/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/eslint-plugin-unicorn?branch=master) +# eslint-plugin-unicorn ![Build Status](https://github.com/sindresorhus/eslint-plugin-unicorn/workflows/CI/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/eslint-plugin-unicorn/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/eslint-plugin-unicorn?branch=master) From 6751832d7e1af99f970544b40a0a9f52367086fb Mon Sep 17 00:00:00 2001 From: fisker Date: Tue, 11 Feb 2020 12:03:55 +0800 Subject: [PATCH 09/18] Add fail-fast --- .github/workflows/ci.yml | 62 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..4dd810fdd9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,62 @@ +name: CI + +on: + - push + - pull_request + +jobs: + test: + name: Node.js ${{ matrix.node_version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + node_version: + - 13 + - 12 + - 10 + os: + - ubuntu-latest + - windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node_version }} + - run: npm install + - run: npm run test-coverage + - uses: coverallsapp/github-action@master + continue-on-error: true + with: + github-token: ${{ secrets.github_token }} + parallel: true + + coverage: + needs: test + runs-on: ubuntu-latest + steps: + - uses: coverallsapp/github-action@master + continue-on-error: true + with: + github-token: ${{ secrets.github_token }} + parallel-finished: true + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm install + - run: npm run lint + + integration: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm install + - run: npm run integration From 91dd5b5ee863cc242cacb3cb258e9d76fb24863b Mon Sep 17 00:00:00 2001 From: fisker Date: Tue, 11 Feb 2020 12:05:37 +0800 Subject: [PATCH 10/18] Fix script --- .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 4dd810fdd9..3b3d5091f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: with: node-version: ${{ matrix.node_version }} - run: npm install - - run: npm run test-coverage + - run: npm run test - uses: coverallsapp/github-action@master continue-on-error: true with: From 13f5e60c4b3ceba84d59ee2c40bc59741f9acf70 Mon Sep 17 00:00:00 2001 From: fisker Date: Tue, 11 Feb 2020 12:25:13 +0800 Subject: [PATCH 11/18] update reporter disable import/order --- package.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 80860d91f3..3e4f438cab 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "node": ">=10" }, "scripts": { - "test": "xo && nyc ava", + "test": "xo && nyc --reporter=lcov ava", "lint": "node ./test/lint/lint.js", "integration": "node ./test/integration/test.js" }, @@ -92,6 +92,9 @@ "eslint-plugin/require-meta-docs-url": "off" } } - ] + ], + "rules": { + "import/order": "off" + } } } From e1fdcb53d3fc8c45d9e2b5c41cce9cffface4c28 Mon Sep 17 00:00:00 2001 From: fisker Date: Wed, 12 Feb 2020 01:47:34 +0800 Subject: [PATCH 12/18] nyc config --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 3e4f438cab..8f12b358d2 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "node": ">=10" }, "scripts": { - "test": "xo && nyc --reporter=lcov ava", + "test": "xo && nyc ava", "lint": "node ./test/lint/lint.js", "integration": "node ./test/integration/test.js" }, @@ -78,6 +78,9 @@ "test/*.js" ] }, + "nyc": { + "reporter": ["lcov"] + }, "xo": { "plugins": [ "eslint-plugin" From 87e7375055532750a6b60e0139173089100c1347 Mon Sep 17 00:00:00 2001 From: fisker Date: Wed, 12 Feb 2020 01:49:17 +0800 Subject: [PATCH 13/18] Remove `parallel` for `coveralls` --- .github/workflows/ci.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b3d5091f6..68ee11348b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,17 +29,6 @@ jobs: continue-on-error: true with: github-token: ${{ secrets.github_token }} - parallel: true - - coverage: - needs: test - runs-on: ubuntu-latest - steps: - - uses: coverallsapp/github-action@master - continue-on-error: true - with: - github-token: ${{ secrets.github_token }} - parallel-finished: true lint: runs-on: ubuntu-latest From f8ceedcf5c96c2766b285fb28f59c5af62c58351 Mon Sep 17 00:00:00 2001 From: fisker Date: Wed, 12 Feb 2020 02:02:52 +0800 Subject: [PATCH 14/18] Add condition for coveralls --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68ee11348b..62eb653545 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,7 @@ jobs: - run: npm install - run: npm run test - uses: coverallsapp/github-action@master + if: matrix.os == 'ubuntu-latest' || matrix.node_version == 12 continue-on-error: true with: github-token: ${{ secrets.github_token }} From ef390cf451370c6e8cf1893793fd311b67fca6c7 Mon Sep 17 00:00:00 2001 From: fisker Date: Wed, 12 Feb 2020 02:06:18 +0800 Subject: [PATCH 15/18] Fix condition --- .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 62eb653545..0c7a5fe56b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - run: npm install - run: npm run test - uses: coverallsapp/github-action@master - if: matrix.os == 'ubuntu-latest' || matrix.node_version == 12 + if: matrix.os == 'ubuntu-latest' && matrix.node_version == 12 continue-on-error: true with: github-token: ${{ secrets.github_token }} From 108eb6e64e6074f8c113b6f6b8ad03059ff00cd6 Mon Sep 17 00:00:00 2001 From: fisker Date: Wed, 12 Feb 2020 02:11:42 +0800 Subject: [PATCH 16/18] Remove `continue-on-error` for now --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c7a5fe56b..4b17a48c73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,6 @@ jobs: - run: npm run test - uses: coverallsapp/github-action@master if: matrix.os == 'ubuntu-latest' && matrix.node_version == 12 - continue-on-error: true with: github-token: ${{ secrets.github_token }} From d9961a1d8ea00d3c057edd8a5255990835decc8d Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Wed, 12 Feb 2020 01:20:11 +0700 Subject: [PATCH 17/18] Update package.json --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 8f12b358d2..73f4427ee5 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,9 @@ ] }, "nyc": { - "reporter": ["lcov"] + "reporter": [ + "lcov" + ] }, "xo": { "plugins": [ From 0a2c1805a0cdca937d7aab5df6e4859ccd16dff1 Mon Sep 17 00:00:00 2001 From: fisker Date: Wed, 12 Feb 2020 02:22:52 +0800 Subject: [PATCH 18/18] Add missing link --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 55bfdaf509..09fdc932e6 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# eslint-plugin-unicorn ![Build Status](https://github.com/sindresorhus/eslint-plugin-unicorn/workflows/CI/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/eslint-plugin-unicorn/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/eslint-plugin-unicorn?branch=master) +# eslint-plugin-unicorn [![Build Status](https://github.com/sindresorhus/eslint-plugin-unicorn/workflows/CI/badge.svg)](https://github.com/sindresorhus/eslint-plugin-unicorn/actions) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/eslint-plugin-unicorn/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/eslint-plugin-unicorn?branch=master)