From d3b7ded3ff4d4a5e11cc66677214ff9fd94fbfbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Sun, 14 Mar 2021 21:18:02 +0100 Subject: [PATCH 01/16] ci: schedule github actions updates --- .github/dependabot.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..c54be545 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + # Set update schedule for GitHub Actions + - package-ecosystem: 'github-actions' + directory: '/' + schedule: + interval: 'daily' From 44a4b410287dc3bc4c663a72c190951b57d0a435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Sun, 14 Mar 2021 23:20:01 +0100 Subject: [PATCH 02/16] ci: add github actions release workflow --- .github/workflows/release.yml | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..c89ea59c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +name: Release + +on: + push: + branches: + # semantic-release valid branches + - '+([0-9])?(.{+([0-9]),x}).x' + - 'main' + - 'next' + - 'next-major' + - 'beta' + - 'alpha' + +jobs: + main: + name: NPM Release + runs-on: ubuntu-latest + + strategy: + matrix: + node: [10.12, 10, 12.0, 12, 14, 15] + eslint: [5, 6, 7] + + steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Use Node + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + + - name: Install dependencies + run: npm ci + + - name: Install specific ESLint + run: npm install --no-save eslint@${{ matrix.eslint }} + + - name: Run tests + run: npm run test:ci + + - name: Build package + run: npm run build + + - name: Release new version to NPM + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npx semantic-release From 4667c221412973e288cfb417661a983741838c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Sun, 14 Mar 2021 23:27:51 +0100 Subject: [PATCH 03/16] ci: remove config related to travis --- .travis.yml | 34 ---------------------------------- package.json | 4 +--- 2 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index eee7f934..00000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -language: node_js - -env: - global: - - FORCE_COLOR=true - matrix: - - ESLINT=5 - - ESLINT=6 - - ESLINT=7 - -node_js: - - 10.12 - - 10 - - 12.0 - - 12 - - 14 - -before_script: - - 'if [ -n "${ESLINT-}" ]; then npm install --no-save "eslint@${ESLINT}" ; fi' - -jobs: - include: - - stage: release - if: branch = main AND type != pull_request AND fork = false - node_js: 14 - env: ESLINT=7 - script: npm run build - deploy: - provider: script - skip_cleanup: true - on: - branch: main - script: - - npx semantic-release diff --git a/package.json b/package.json index afd0dde4..9bb6db82 100644 --- a/package.json +++ b/package.json @@ -44,11 +44,10 @@ "lint": "eslint . --ext .js,.ts", "lint:fix": "npm run lint -- --fix", "format": "prettier --write README.md {lib,docs,tests}/**/*.{js,md}", - "test:local": "jest", + "test": "jest", "test:ci": "jest --coverage", "test:update": "npm run test:local -- --u", "test:watch": "npm run test:local -- --watch", - "test": "is-ci test:ci test:local", "semantic-release": "semantic-release" }, "dependencies": { @@ -72,7 +71,6 @@ "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", "husky": "^4.3.0", - "is-ci-cli": "^2.1.2", "jest": "^25.5.4", "lint-staged": "^9.5.0", "prettier": "1.19.1", From b25fdbd7b822d5c8d9c601b6bc7149b8e42a7f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Sun, 14 Mar 2021 23:47:51 +0100 Subject: [PATCH 04/16] ci: split workflows --- .github/workflows/ci.yml | 64 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 17 +++------- 2 files changed, 69 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..04c415c9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,64 @@ +name: CI + +on: + push: + branches: + # semantic-release valid branches + - '+([0-9])?(.{+([0-9]),x}).x' + - 'main' + - 'next' + - 'next-major' + - 'beta' + - 'alpha' + pull_request: + types: [opened, synchronize] + +jobs: + code_validation: + name: Code Validation + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Use Node + uses: actions/setup-node@v1 + with: + node-version: 14 + + - name: Install dependencies + run: npm ci + + - name: Lint code + run: npm run lint -- --max-warnings 0 + + - name: Check format + run: npm run format:check + + test: + name: Tests (Node v${{ matrix.node }} - ESLint v${{ matrix.eslint }}) + runs-on: ubuntu-latest + + strategy: + matrix: + node: [10.12, 10, 12.0, 12, 14, 15] + eslint: [5, 6, 7] + + steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Use Node + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + + - name: Install dependencies + run: npm ci + + - name: Install specific ESLint + run: npm install --no-save eslint@${{ matrix.eslint }} + + - name: Run tests + run: npm run test:ci diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c89ea59c..332552d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,10 @@ name: Release on: + workflow_run: + workflows: ['CI'] + types: + - completed push: branches: # semantic-release valid branches @@ -16,11 +20,6 @@ jobs: name: NPM Release runs-on: ubuntu-latest - strategy: - matrix: - node: [10.12, 10, 12.0, 12, 14, 15] - eslint: [5, 6, 7] - steps: - name: Checkout uses: actions/checkout@v1 @@ -28,17 +27,11 @@ jobs: - name: Use Node uses: actions/setup-node@v1 with: - node-version: ${{ matrix.node }} + node-version: 14 - name: Install dependencies run: npm ci - - name: Install specific ESLint - run: npm install --no-save eslint@${{ matrix.eslint }} - - - name: Run tests - run: npm run test:ci - - name: Build package run: npm run build From 2b7c944510eaad52ff85e0e608c27e93fd6e2a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Sun, 14 Mar 2021 23:56:29 +0100 Subject: [PATCH 05/16] ci: use action for installing dependencies --- .github/workflows/ci.yml | 10 +++++++--- .github/workflows/release.yml | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04c415c9..b8bd94cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,9 @@ jobs: node-version: 14 - name: Install dependencies - run: npm ci + uses: bahmutov/npm-install@v1 + with: + useLockFile: false - name: Lint code run: npm run lint -- --max-warnings 0 @@ -55,9 +57,11 @@ jobs: node-version: ${{ matrix.node }} - name: Install dependencies - run: npm ci + uses: bahmutov/npm-install@v1 + with: + useLockFile: false - - name: Install specific ESLint + - name: Install ESLint v${{ matrix.eslint }} run: npm install --no-save eslint@${{ matrix.eslint }} - name: Run tests diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 332552d2..1d033816 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,9 @@ jobs: node-version: 14 - name: Install dependencies - run: npm ci + uses: bahmutov/npm-install@v1 + with: + useLockFile: false - name: Build package run: npm run build From 9c8f687ece2a3fb5f2d002faf3a6d7f66fd42c63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Sun, 14 Mar 2021 23:58:52 +0100 Subject: [PATCH 06/16] ci: remove lint max warnings --- .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 b8bd94cf..5d017965 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: useLockFile: false - name: Lint code - run: npm run lint -- --max-warnings 0 + run: npm run lint - name: Check format run: npm run format:check From 3692bd0ca825c6cb777e182ea79aed19c05167ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Mon, 15 Mar 2021 00:03:01 +0100 Subject: [PATCH 07/16] ci: improve scripts --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 9bb6db82..cb1b58a1 100644 --- a/package.json +++ b/package.json @@ -44,8 +44,9 @@ "lint": "eslint . --ext .js,.ts", "lint:fix": "npm run lint -- --fix", "format": "prettier --write README.md {lib,docs,tests}/**/*.{js,md}", + "format:check": "prettier --check README.md \"{lib,docs,tests}/**/*.{js,json,yml,ts,md}\"", "test": "jest", - "test:ci": "jest --coverage", + "test:ci": "jest --ci --coverage", "test:update": "npm run test:local -- --u", "test:watch": "npm run test:local -- --watch", "semantic-release": "semantic-release" From bbb5bd65b8b6e3854a3dc1a91219b964dfcb61bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Mon, 15 Mar 2021 00:09:26 +0100 Subject: [PATCH 08/16] ci: remove format check --- .github/workflows/ci.yml | 5 +++-- package.json | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d017965..823db72e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,8 +35,9 @@ jobs: - name: Lint code run: npm run lint - - name: Check format - run: npm run format:check + # TODO: reenable on v4 +# - name: Check format +# run: npm run format:check test: name: Tests (Node v${{ matrix.node }} - ESLint v${{ matrix.eslint }}) diff --git a/package.json b/package.json index cb1b58a1..4faa5a78 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,6 @@ "lint": "eslint . --ext .js,.ts", "lint:fix": "npm run lint -- --fix", "format": "prettier --write README.md {lib,docs,tests}/**/*.{js,md}", - "format:check": "prettier --check README.md \"{lib,docs,tests}/**/*.{js,json,yml,ts,md}\"", "test": "jest", "test:ci": "jest --ci --coverage", "test:update": "npm run test:local -- --u", From b846a928bcc1224b79f99e8dfb29c4973dc9dc0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Mon, 15 Mar 2021 00:27:40 +0100 Subject: [PATCH 09/16] ci: install dependencies with npm --- .github/workflows/ci.yml | 12 ++++++------ .github/workflows/release.yml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 823db72e..f96fd444 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,9 +23,9 @@ jobs: uses: actions/checkout@v1 - name: Use Node - uses: actions/setup-node@v1 - with: - node-version: 14 + run: npm install --no-save + env: + CI: true - name: Install dependencies uses: bahmutov/npm-install@v1 @@ -53,9 +53,9 @@ jobs: uses: actions/checkout@v1 - name: Use Node - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} + run: npm install --no-save + env: + CI: true - name: Install dependencies uses: bahmutov/npm-install@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1d033816..8e87c291 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,9 +25,9 @@ jobs: uses: actions/checkout@v1 - name: Use Node - uses: actions/setup-node@v1 - with: - node-version: 14 + run: npm install --no-save + env: + CI: true - name: Install dependencies uses: bahmutov/npm-install@v1 From 4012c24fa8d430ead4ffdc08fd8886f816aab27c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Mon, 15 Mar 2021 00:31:52 +0100 Subject: [PATCH 10/16] ci: revert - install dependencies with npm --- .github/workflows/ci.yml | 12 ++++++------ .github/workflows/release.yml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f96fd444..823db72e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,9 +23,9 @@ jobs: uses: actions/checkout@v1 - name: Use Node - run: npm install --no-save - env: - CI: true + uses: actions/setup-node@v1 + with: + node-version: 14 - name: Install dependencies uses: bahmutov/npm-install@v1 @@ -53,9 +53,9 @@ jobs: uses: actions/checkout@v1 - name: Use Node - run: npm install --no-save - env: - CI: true + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} - name: Install dependencies uses: bahmutov/npm-install@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8e87c291..1d033816 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,9 +25,9 @@ jobs: uses: actions/checkout@v1 - name: Use Node - run: npm install --no-save - env: - CI: true + uses: actions/setup-node@v1 + with: + node-version: 14 - name: Install dependencies uses: bahmutov/npm-install@v1 From b4fb98259c9896bd15a834ad840dbdee1319ea16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Mon, 15 Mar 2021 00:34:11 +0100 Subject: [PATCH 11/16] ci: install dependencies manually on test step --- .github/workflows/ci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 823db72e..0fa14c42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,10 +57,8 @@ jobs: with: node-version: ${{ matrix.node }} - - name: Install dependencies - uses: bahmutov/npm-install@v1 - with: - useLockFile: false + - name: Install dependencies (no cache) + run: npm install --no-save - name: Install ESLint v${{ matrix.eslint }} run: npm install --no-save eslint@${{ matrix.eslint }} From d4a1af0e29202033e930cf07ecec128d047751e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Mon, 15 Mar 2021 00:37:22 +0100 Subject: [PATCH 12/16] ci: set ci env var on install step --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0fa14c42..0ed27df1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,6 +59,8 @@ jobs: - name: Install dependencies (no cache) run: npm install --no-save + env: + CI: true - name: Install ESLint v${{ matrix.eslint }} run: npm install --no-save eslint@${{ matrix.eslint }} From b69893f8b47b22970dadf5ef521b4df172d998fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Mon, 15 Mar 2021 00:40:01 +0100 Subject: [PATCH 13/16] ci: install peer deps in legacy mode --- .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 0ed27df1..a7289a3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,7 @@ jobs: node-version: ${{ matrix.node }} - name: Install dependencies (no cache) - run: npm install --no-save + run: npm install --no-save --legacy-peer-deps env: CI: true From 199ae483ae14dbbffc231fe10b1be1ba0ed5f75e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Mon, 15 Mar 2021 00:43:38 +0100 Subject: [PATCH 14/16] ci: revert manual deps install --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7289a3e..823db72e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,10 +57,10 @@ jobs: with: node-version: ${{ matrix.node }} - - name: Install dependencies (no cache) - run: npm install --no-save --legacy-peer-deps - env: - CI: true + - name: Install dependencies + uses: bahmutov/npm-install@v1 + with: + useLockFile: false - name: Install ESLint v${{ matrix.eslint }} run: npm install --no-save eslint@${{ matrix.eslint }} From 6fcc3d4c4409ef9ea9ccd2182d2b2236cca0c262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Mon, 15 Mar 2021 00:57:33 +0100 Subject: [PATCH 15/16] ci: remove node 15 --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/release.yml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 823db72e..199da601 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,9 +23,9 @@ jobs: uses: actions/checkout@v1 - name: Use Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: - node-version: 14 + node-version: '14' - name: Install dependencies uses: bahmutov/npm-install@v1 @@ -45,7 +45,7 @@ jobs: strategy: matrix: - node: [10.12, 10, 12.0, 12, 14, 15] + node: ['10.12', '10', '12.0', '12', '14'] eslint: [5, 6, 7] steps: @@ -53,7 +53,7 @@ jobs: uses: actions/checkout@v1 - name: Use Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: node-version: ${{ matrix.node }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1d033816..4128186b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,9 +25,9 @@ jobs: uses: actions/checkout@v1 - name: Use Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: - node-version: 14 + node-version: '14' - name: Install dependencies uses: bahmutov/npm-install@v1 From 1461bf27d7335f4c33c4161b88b2e56234b3f82a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Mon, 15 Mar 2021 01:07:31 +0100 Subject: [PATCH 16/16] ci: update badge in README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e7e46d09..03f7f89d 100644 --- a/README.md +++ b/README.md @@ -153,8 +153,8 @@ To enable this configuration use the `extends` property in your | [prefer-screen-queries](docs/rules/prefer-screen-queries.md) | Suggest using screen while using queries | | | | [prefer-wait-for](docs/rules/prefer-wait-for.md) | Use `waitFor` instead of deprecated wait methods | | ![fixable-badge][] | -[build-badge]: https://img.shields.io/travis/testing-library/eslint-plugin-testing-library?style=flat-square -[build-url]: https://travis-ci.org/testing-library/eslint-plugin-testing-library +[build-badge]: https://github.com/testing-library/eslint-plugin-testing-library/actions/workflows/ci.yml/badge.svg +[build-url]: https://github.com/testing-library/eslint-plugin-testing-library/actions/workflows/ci.yml [version-badge]: https://img.shields.io/npm/v/eslint-plugin-testing-library?style=flat-square [version-url]: https://www.npmjs.com/package/eslint-plugin-testing-library [license-badge]: https://img.shields.io/npm/l/eslint-plugin-testing-library?style=flat-square